답안 #5670

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
5670 2014-05-10T13:25:17 Z sinceww77 그릇 (KOI13_bowl) C++
16 / 16
0 ms 1088 KB
#include <stdio.h>
#include <string.h>
int main()
{
    int i,j,check=0,n,len,cnt=0;
    char a[1000];
    scanf("%s",a);
    len=strlen(a);
    for(i=0;i<len;i++)
    {
        if(i==0)
        {
            cnt+=10;
            if(a[i]=='(') check=1;
            else check=2;
        }
        else if(check==1)
        {
            if(a[i]=='(') cnt+=5;
            else
            {
                check=2;
                cnt+=10;
            }
        }
        else if(check==2)
        {
            if(a[i]==')') cnt+=5;
            else
            {
                check=1;
                cnt+=10;
            }
        }
    }
    printf("%d",cnt);
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 1088 KB Output is correct
2 Correct 0 ms 1088 KB Output is correct
3 Correct 0 ms 1088 KB Output is correct
4 Correct 0 ms 1088 KB Output is correct
5 Correct 0 ms 1088 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 1088 KB Output is correct
2 Correct 0 ms 1088 KB Output is correct
3 Correct 0 ms 1088 KB Output is correct
4 Correct 0 ms 1088 KB Output is correct
5 Correct 0 ms 1088 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 1088 KB Output is correct
2 Correct 0 ms 1088 KB Output is correct
3 Correct 0 ms 1088 KB Output is correct
4 Correct 0 ms 1088 KB Output is correct
5 Correct 0 ms 1088 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 1088 KB Output is correct
2 Correct 0 ms 1088 KB Output is correct
3 Correct 0 ms 1088 KB Output is correct
4 Correct 0 ms 1088 KB Output is correct
5 Correct 0 ms 1088 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 1088 KB Output is correct
2 Correct 0 ms 1088 KB Output is correct
3 Correct 0 ms 1088 KB Output is correct
4 Correct 0 ms 1088 KB Output is correct
5 Correct 0 ms 1088 KB Output is correct