Submission #72272
ソースコード
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | #include<bits/stdc++.h> #define ll long long #define gre greater #define pb push_back #define mp make_pair #define fore(i,a) for(auto &i:a) #define all(x) (x).begin(),x.end() #define npt(v) next_permutation(v.begin(), v.end()) #define purace(n,x,a,b) (n%x!=0?a:b) using namespace std; int main(){ cin.tie(nullptr); ios_base::sync_with_stdio( false ); int n; cin>>n; vector< int > data(n); for ( int i=0;i<n;i++){ cin>>data[i]; data[i]/=10; } int sum=0,now=0; for ( int i=0;i<n;i++){ if (sum<i){ cout<< "no" <<endl; return 0; } sum=max(sum,i+data[i]); } reverse(all(data)); sum=0; now=0; for ( int i=0;i<n;i++){ if (sum<i){ cout<< "no" <<endl; return 0; } sum=max(sum,i+data[i]); } cout<< "yes" <<endl; return (0); } |
ステータス
項目 | データ |
---|---|
問題 | 0960 - トランポリン |
ユーザー名 | ei2119 |
投稿日時 | 2022-09-01 14:53:53 |
言語 | C++17 |
状態 | Accepted |
得点 | 11 |
ソースコード長 | 918 Byte |
最大実行時間 | 57 ms |
最大メモリ使用量 | 1892 KB |
セット
セット | 得点 | Cases | |
---|---|---|---|
1 | ALL | 11 / 11 | * |
テストケース
ファイル名 | 状態 | 実行時間 | メモリ使用量 | # |
---|---|---|---|---|
in1.txt | AC | 21 ms | 476 KB |
1
|
in2.txt | AC | 23 ms | 484 KB |
1
|
in3.txt | AC | 22 ms | 624 KB |
1
|
in4.txt | AC | 21 ms | 656 KB |
1
|
in5.txt | AC | 23 ms | 664 KB |
1
|
in6.txt | AC | 20 ms | 624 KB |
1
|
in7.txt | AC | 20 ms | 580 KB |
1
|
in8.txt | AC | 44 ms | 1816 KB |
1
|
in9.txt | AC | 35 ms | 1752 KB |
1
|
in10.txt | AC | 57 ms | 1708 KB |
1
|
in11.txt | AC | 21 ms | 488 KB |
1
|
in12.txt | AC | 17 ms | 572 KB |
1
|
in13.txt | AC | 20 ms | 660 KB |
1
|
in14.txt | AC | 24 ms | 616 KB |
1
|
in15.txt | AC | 18 ms | 444 KB |
1
|
in16.txt | AC | 24 ms | 656 KB |
1
|
in17.txt | AC | 26 ms | 612 KB |
1
|
in18.txt | AC | 32 ms | 440 KB |
1
|
in19.txt | AC | 23 ms | 396 KB |
1
|
in20.txt | AC | 22 ms | 564 KB |
1
|
in21.txt | AC | 19 ms | 644 KB |
1
|
in22.txt | AC | 22 ms | 608 KB |
1
|
in23.txt | AC | 20 ms | 568 KB |
1
|
in24.txt | AC | 19 ms | 648 KB |
1
|
in25.txt | AC | 21 ms | 600 KB |
1
|
in26.txt | AC | 18 ms | 556 KB |
1
|
in27.txt | AC | 27 ms | 636 KB |
1
|
in28.txt | AC | 20 ms | 552 KB |
1
|
in29.txt | AC | 18 ms | 592 KB |
1
|
in30.txt | AC | 17 ms | 700 KB |
1
|
in31.txt | AC | 19 ms | 1116 KB |
1
|
in32.txt | AC | 33 ms | 1832 KB |
1
|
in33.txt | AC | 39 ms | 1892 KB |
1
|
in34.txt | AC | 37 ms | 1820 KB |
1
|
in35.txt | AC | 36 ms | 1884 KB |
1
|
in36.txt | AC | 39 ms | 1820 KB |
1
|
in37.txt | AC | 41 ms | 1880 KB |
1
|
in38.txt | AC | 36 ms | 1688 KB |
1
|
in39.txt | AC | 30 ms | 1744 KB |
1
|
in40.txt | AC | 36 ms | 1760 KB |
1
|