This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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];
}
if(i!=0&&a1=='('&&a2=='(') {
sum+=5;
a1='(';
}
if(i!=0&&a1=='('&&a2==')') {
sum+=10;
a1=')';
}
if(i!=0&&a1==')'&&a2=='(') {
sum+=10;
a1='(';
}
if(i!=0&&a1==')'&&a2==')') {
sum+=5;
a1=')';
}
}
printf("%d\n",sum);
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |