提出 #34203956
ソースコード 拡げる
#include<bits/stdc++.h>
#define int long long
using namespace std;int n,m,t,a[100010],b[100010],x,y;void Solve_Test(){scanf("%lld%lld%lld",&n,&m,&t);for(int i=1;i<n;++i)scanf("%lld",&a[i]);for(int i=1;i<=m;++i)scanf("%lld%lld",&x,&y),b[x-1]+=y;for(int i=1;i<n;++i){if((t-=a[i])<=0)return printf("No"),void();t+=b[i];}printf("Yes");}const bool BASE=0;int T=1;signed main(){if(BASE)cin>>T;while(T--)Solve_Test();return 0;}
提出情報
提出日時
2022-08-21 21:05:23+0900
問題
B - Explore
ユーザ
Treap
言語
C++ (GCC 9.2.1)
得点
200
コード長
422 Byte
結果
AC
実行時間
42 ms
メモリ
5312 KiB
コンパイルエラー
./Main.cpp: In function ‘void Solve_Test()’:
./Main.cpp:3:78: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
3 | using namespace std;int n,m,t,a[100010],b[100010],x,y;void Solve_Test(){scanf("%lld%lld%lld",&n,&m,&t);for(int i=1;i<n;++i)scanf("%lld",&a[i]);for(int i=1;i<=m;++i)scanf("%lld%lld",&x,&y),b[x-1]+=y;for(int i=1;i<n;++i){if((t-=a[i])<=0)return printf("No"),void();t+=b[i];}printf("Yes");}const bool BASE=0;int T=1;signed main(){if(BASE)cin>>T;while(T--)Solve_Test();return 0;}
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
./Main.cpp:3:129: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
3 | using namespace std;int n,m,t,a[100010],b[100010],x,y;void Solve_Test(){scanf("%lld%lld%lld",&n,&m,&t);for(int i=1;i<n;++i)scanf("%lld",&a[i]);for(int i=1;i<=m;++i)scanf("%lld%lld",&x,&y),b[x-1]+=y;for(int i=1;i<n;++i){if((t-=a[i])<=0)return printf("No"),void();t+=b[i];}printf("Yes");}const bool BASE=0;int T=1;signed main(){if(BASE)cin>>T;while(T--)Solve_Test();return 0;}
| ~~~~~^~~~~~~~~~~~~~
./Main.cpp:3:170: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
3 | using namespace std;int n,m,t,a[100010],b[100010],x,y;void Solve_Test(){scanf("%lld%lld%lld",&n,&m,&t);for(int i=1;i<n;++i)scanf("%lld",&a[i]);for(int i=1;i<=m;++i)scanf("%lld%lld",&x,&y),b[x-1]+=y;for(int i=1;i<n;++i){if((t-=a[i])<=0)return printf("No"),void();t+=b[i];}printf("Yes");}const bool BASE=0;int T=1;signed main(){if(BASE)cin>>T;while(T--)Solve_Test();return 0;}
| ...
ジャッジ結果
セット名
Sample
All
得点 / 配点
0 / 0
200 / 200
結果
セット名
テストケース
Sample
sample_01.txt, sample_02.txt
All
hand_01.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, random_14.txt, random_15.txt, random_16.txt, random_17.txt, random_18.txt, random_19.txt, random_20.txt, random_21.txt, random_22.txt, random_23.txt, sample_01.txt, sample_02.txt
ケース名
結果
実行時間
メモリ
hand_01.txt
AC
5 ms
3676 KiB
random_01.txt
AC
37 ms
5312 KiB
random_02.txt
AC
12 ms
3996 KiB
random_03.txt
AC
36 ms
5184 KiB
random_04.txt
AC
9 ms
3728 KiB
random_05.txt
AC
38 ms
5080 KiB
random_06.txt
AC
14 ms
3984 KiB
random_07.txt
AC
37 ms
5188 KiB
random_08.txt
AC
21 ms
4336 KiB
random_09.txt
AC
31 ms
5184 KiB
random_10.txt
AC
20 ms
4380 KiB
random_11.txt
AC
36 ms
5212 KiB
random_12.txt
AC
15 ms
4092 KiB
random_13.txt
AC
36 ms
5188 KiB
random_14.txt
AC
17 ms
4308 KiB
random_15.txt
AC
35 ms
5184 KiB
random_16.txt
AC
19 ms
4336 KiB
random_17.txt
AC
42 ms
5228 KiB
random_18.txt
AC
40 ms
5052 KiB
random_19.txt
AC
37 ms
5128 KiB
random_20.txt
AC
20 ms
4388 KiB
random_21.txt
AC
3 ms
3636 KiB
random_22.txt
AC
3 ms
3572 KiB
random_23.txt
AC
3 ms
3524 KiB
sample_01.txt
AC
2 ms
3672 KiB
sample_02.txt
AC
3 ms
3532 KiB