Submission #00135


ソースコード

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
51
#include<stdio.h>
int main(){
long long a,b,d=1,f,g,h=0;
scanf("%lld",&a);
long long c[a];
for(b=0;b<a;b++){
scanf("%lld",&c[b]);
}
for(b=0;b<a-1;b++){
d*=2;
}
long long e=d/2,i[d],j=d;
for(b=0;b<d;b++){
i[b]=0;
}
for(f=0;f<a-1;f++){
h=0;
for(b=0;b<d;b++){
if(b%e==0){
if(h==0){
h=1;
}
else{
h=0;
}
}
if(h==0&&i[b]!=100){
i[b]+=c[f];
if(i[b]>20||i[b]<0){
i[b]=100;
j--;
}
}
if(h==1&&i[b]!=100){
i[b]-=c[f];
if(i[b]>20||i[b]<0){
i[b]=100;
j--;
}
}
if(f==a-2&&i[b]!=100){
if(i[b]!=c[a-1]){
j--;
}
}
}
e/=2;
}
printf("%lld\n",j);
return(0);
}

ステータス

項目 データ
問題 0004 - 1年生 (A First Grader)
ユーザー名 e1613
投稿日時 2016-11-09 18:55:32
言語 C++11
状態 Runtime Error
得点 20
ソースコード長 727 Byte
最大実行時間 96 ms
最大メモリ使用量 4576 KB

セット

セット 得点 Cases
1 入力1 20 / 20 *1.txt
2 入力2 0 / 20 *2.txt
3 入力3 0 / 20 *3.txt
4 入力4 0 / 20 *4.txt
5 入力5 0 / 20 *5.txt

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
2011-yo-t4-in1.txt AC 96 ms 4576 KB
1
2011-yo-t4-in2.txt RE 24 ms 472 KB
2
2011-yo-t4-in3.txt RE 26 ms 468 KB
3
2011-yo-t4-in4.txt RE 28 ms 460 KB
4
2011-yo-t4-in5.txt RE 27 ms 460 KB
5