Submission #00038


ソースコード

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
#include <iostream>
#include <cstdio>
using namespace std;
int main()
{
int a[105],n,now = 0,pn = 1,p = 0,i = 0;
scanf("%d",&n);
for(int j = 0;j < n;j++){
scanf("%d",&a[j]);
}
while(i != n - 1){
for(int j = now;j < n;j++){
if(a[j] == 1 && a[j + 1] == 1){
pn++;
}else if(a[j] == 1 && a[j + 1] == 0 || j == n - 1){
pn++;
if(p <= pn){
p = pn;
now = j;
pn = 0;
break;
}
}
}
i++;
}
printf("%d\n",p);
return(0);
}

ステータス

項目 データ
問題 0002 - 双六 (Sugoroku)
ユーザー名 卒業済みr1807
投稿日時 2018-11-21 17:39:20
言語 C++
状態 Wrong Answer
得点 0
ソースコード長 507 Byte
最大実行時間 30 ms
最大メモリ使用量 604 KB

セット

セット 得点 Cases
1 ALL 0 / 100 *

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
01-01.txt WA 30 ms 604 KB
1
01-02.txt WA 25 ms 448 KB
1
01-03.txt WA 24 ms 420 KB
1
01-04.txt WA 23 ms 392 KB
1
01-05.txt WA 18 ms 492 KB
1
01-06.txt WA 24 ms 596 KB
1
01-07.txt WA 17 ms 564 KB
1
01-08.txt AC 23 ms 536 KB
1
01-09.txt WA 23 ms 380 KB
1
01-10.txt AC 22 ms 480 KB
1
sample-01.txt AC 26 ms 448 KB
1
sample-02.txt AC 19 ms 552 KB
1
sample-03.txt AC 25 ms 528 KB
1