Submission #15734

# Submission time Handle Problem Language Result Execution time Memory
15734 2015-07-18T19:24:58 Z cki86201 볼질 (OJUZ10_ballparade) C++
100 / 100
9 ms 1084 KB
#include<stdio.h>

int p[4];

int main(){
	int n;
	scanf("%d",&n);
	int ans = 0;
	for(int i=0, x, now = 0;i<n;i++){
		scanf("%d",&x);
		if(x == 3)ans += p[3], p[3] = p[2], p[2] = p[1], p[1] = 0;
		if(x == 1 || x == 3){
			now++;
		}
		if(x == 2 || now == 4){
			ans += (p[3]&p[2]&p[1]);
			p[3] |= (p[1]&p[2]);
			p[2] |= p[1];
			p[1] = 1, now = 0;
		}
	}
	printf("%d",ans);
	return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 1084 KB Output is correct
2 Correct 0 ms 1084 KB Output is correct
3 Correct 0 ms 1084 KB Output is correct
4 Correct 0 ms 1084 KB Output is correct
5 Correct 4 ms 1084 KB Output is correct
6 Correct 0 ms 1084 KB Output is correct
7 Correct 0 ms 1084 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 1084 KB Output is correct
2 Correct 0 ms 1084 KB Output is correct
3 Correct 4 ms 1084 KB Output is correct
4 Correct 0 ms 1084 KB Output is correct
5 Correct 0 ms 1084 KB Output is correct
6 Correct 0 ms 1084 KB Output is correct
7 Correct 0 ms 1084 KB Output is correct
8 Correct 3 ms 1084 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 8 ms 1084 KB Output is correct
2 Correct 7 ms 1084 KB Output is correct
3 Correct 0 ms 1084 KB Output is correct
4 Correct 0 ms 1084 KB Output is correct
5 Correct 0 ms 1084 KB Output is correct
6 Correct 0 ms 1084 KB Output is correct
7 Correct 0 ms 1084 KB Output is correct
8 Correct 5 ms 1084 KB Output is correct
9 Correct 6 ms 1084 KB Output is correct
10 Correct 9 ms 1084 KB Output is correct
11 Correct 5 ms 1084 KB Output is correct
12 Correct 4 ms 1084 KB Output is correct
13 Correct 6 ms 1084 KB Output is correct
14 Correct 0 ms 1084 KB Output is correct
15 Correct 5 ms 1084 KB Output is correct