Submission #14380

# Submission time Handle Problem Language Result Execution time Memory
14380 2015-05-13T13:51:28 Z dydnjs 그릇 (KOI13_bowl) C++
16 / 16
0 ms 1084 KB
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<algorithm>
#include<queue>
#define INF 987654321
using namespace std;
char a[51];
int main() {
	//freopen("input.txt","r", stdin);
	int i,j,sum=0;
	scanf("%s", a);
	char a1, a2;
	for(i=0; i<strlen(a); i++) {
		a2=a[i];
		if(i==0) {
			sum+=10;
			a1=a[i];
		}
		else if(i!=0&&a1=='('&&a2=='(') {
			sum+=5;
			a1='(';
		}
		else if(i!=0&&a1=='('&&a2==')') {
			sum+=10;
			a1=')';
		}
		else if(i!=0&&a1==')'&&a2=='(') {
			sum+=10;
			a1='(';
		}
		else if(i!=0&&a1==')'&&a2==')') {
			sum+=5;
			a1=')';
		}
	}
	printf("%d\n",sum);
	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 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 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
# 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 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 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
# 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 0 ms 1084 KB Output is correct