Submission #00054
ソースコード
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 50 | #include <iostream> #include <cstdio> using namespace std; int main() { int a[105],n,now = 0,pn = 1,p = 0,i = 0,re = 0; scanf ( "%d" ,&n); for ( int j = 0;j < n;j++){ scanf ( "%d" ,&a[j]); } while (i != n - 1){ cout << "i" << " " << i << endl; cout << "\n" ; for ( int j = now;j < n;j++){ cout << "j" << " " << j << endl; if (a[j] == 1 && a[j + 1] == 1){ pn++; cout << "pn" << " " << pn << endl; cout << "\n" ; } else if (a[j] == 1 && a[j + 1] == 0 || j == n - 1){ pn++; if (p <= pn){ p = pn; cout << "pn" << " " << pn << endl; cout << "\n" ; pn = 0; } else { pn++; p = pn; cout << "pn" << " " << pn << endl; break ; } } } i++; } for ( int j = 0;j < n;j++){ if (a[j] == 0){ re++; } else { break ; } } if (re == n){ printf ( "1\n" ); } else { printf ( "%d\n" ,p); } return (0); } |
ステータス
項目 | データ |
---|---|
問題 | 0002 - 双六 (Sugoroku) |
ユーザー名 | 卒業済みr1807 |
投稿日時 | 2018-11-21 19:15:48 |
言語 | C++ |
状態 | Wrong Answer |
得点 | 0 |
ソースコード長 | 931 Byte |
最大実行時間 | 66 ms |
最大メモリ使用量 | 984 KB |
セット
セット | 得点 | Cases | |
---|---|---|---|
1 | ALL | 0 / 100 | * |
テストケース
ファイル名 | 状態 | 実行時間 | メモリ使用量 | # |
---|---|---|---|---|
01-01.txt | WA | 47 ms | 604 KB |
1
|
01-02.txt | WA | 20 ms | 444 KB |
1
|
01-03.txt | WA | 28 ms | 540 KB |
1
|
01-04.txt | WA | 22 ms | 636 KB |
1
|
01-05.txt | WA | 29 ms | 608 KB |
1
|
01-06.txt | WA | 43 ms | 712 KB |
1
|
01-07.txt | WA | 24 ms | 556 KB |
1
|
01-08.txt | WA | 37 ms | 528 KB |
1
|
01-09.txt | WA | 57 ms | 756 KB |
1
|
01-10.txt | WA | 66 ms | 984 KB |
1
|
sample-01.txt | WA | 23 ms | 952 KB |
1
|
sample-02.txt | WA | 25 ms | 928 KB |
1
|
sample-03.txt | WA | 23 ms | 900 KB |
1
|