Submission #00066
ソースコード
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 42 43 44 45 46 47 48 49 | #include <bits/stdc++.h> using namespace std; #define ll long long #define gcd(x,y) __gcd(x,y) //最大公約数 #define lcm(x,y) x/(__gcd(x,y))*y //最小公倍数 int main() { int n; cin >> n; vector< int > d(n); for ( int i = 0; i < n; i++) { cin >> d[i]; d[i] /= 10; } bool status = true ; int check = 0; for ( int i = 0; i < n; i++) { if (check < i) { status = false ; cout << "no\n" ; break ; } check = max(check, i + d[i]); } reverse(d.begin(), d.end()); check = 0; if (status) { for ( int i = 0; i < n; i++) { if (check < i) { status = false ; cout << "no\n" ; break ; } check = max(check, i + d[i]); } } if (status) { cout << "yes\n" ; } return (0); } |
ステータス
項目 | データ |
---|---|
問題 | 0014 - トランポリン |
ユーザー名 | woody_1227 |
投稿日時 | 2022-08-17 23:43:38 |
言語 | C++17 |
状態 | Accepted |
得点 | 120 |
ソースコード長 | 951 Byte |
最大実行時間 | 121 ms |
最大メモリ使用量 | 17428 KB |
セット
セット | 得点 | Cases | |
---|---|---|---|
1 | ALL | 120 / 120 | * |
テストケース
ファイル名 | 状態 | 実行時間 | メモリ使用量 | # |
---|---|---|---|---|
in1.txt | AC | 53 ms | 600 KB |
1
|
in2.txt | AC | 16 ms | 2964 KB |
1
|
in3.txt | AC | 20 ms | 3172 KB |
1
|
in4.txt | AC | 24 ms | 13796 KB |
1
|
in5.txt | AC | 27 ms | 14488 KB |
1
|
in6.txt | AC | 21 ms | 14460 KB |
1
|
in7.txt | AC | 22 ms | 14556 KB |
1
|
in8.txt | AC | 73 ms | 16576 KB |
1
|
in9.txt | AC | 69 ms | 17428 KB |
1
|
in10.txt | AC | 121 ms | 4032 KB |
1
|
in11.txt | AC | 20 ms | 2832 KB |
1
|
in12.txt | AC | 19 ms | 2936 KB |
1
|
in13.txt | AC | 23 ms | 3036 KB |
1
|
in14.txt | AC | 21 ms | 3004 KB |
1
|
in15.txt | AC | 23 ms | 2980 KB |
1
|
in16.txt | AC | 21 ms | 2948 KB |
1
|
in17.txt | AC | 22 ms | 2920 KB |
1
|
in18.txt | AC | 23 ms | 2892 KB |
1
|
in19.txt | AC | 23 ms | 2988 KB |
1
|
in20.txt | AC | 23 ms | 2936 KB |
1
|
in21.txt | AC | 24 ms | 2908 KB |
1
|
in22.txt | AC | 27 ms | 2880 KB |
1
|
in23.txt | AC | 22 ms | 2848 KB |
1
|
in24.txt | AC | 24 ms | 2948 KB |
1
|
in25.txt | AC | 20 ms | 3048 KB |
1
|
in26.txt | AC | 25 ms | 3024 KB |
1
|
in27.txt | AC | 22 ms | 2996 KB |
1
|
in28.txt | AC | 21 ms | 3052 KB |
1
|
in29.txt | AC | 24 ms | 3112 KB |
1
|
in30.txt | AC | 25 ms | 3272 KB |
1
|
in31.txt | AC | 34 ms | 3844 KB |
1
|
in32.txt | AC | 73 ms | 5732 KB |
1
|
in33.txt | AC | 72 ms | 6964 KB |
1
|
in34.txt | AC | 93 ms | 8576 KB |
1
|
in35.txt | AC | 99 ms | 10452 KB |
1
|
in36.txt | AC | 88 ms | 12324 KB |
1
|
in37.txt | AC | 60 ms | 13304 KB |
1
|
in38.txt | AC | 67 ms | 14276 KB |
1
|
in39.txt | AC | 69 ms | 14868 KB |
1
|
in40.txt | AC | 77 ms | 15684 KB |
1
|