Submission #37522414
Source Code Expand
#include <stdio.h>
#include <string.h>
void to_one(int a[]);
int main(void){
char str[300001];
scanf("%s", str);
int len = strlen(str);
int ball[26];
to_one(ball);
int left[len], i_left = 0;
for(int i = 0; i < len; i++){
if(str[i] == '('){
left[i_left] = i;
i_left++;
}
else if(str[i] == ')'){
i_left--;
for(int j = left[i_left]; j < i; j++){
if('a' <= str[j] && str[j] <= 'z'){
if(ball[str[i] - 'a'] == 1){
ball[str[i] - 'a'] = 0;
}
else if(ball[str[i] - 'a'] == 0){
printf("No\n");
return 0;
}
}
}
to_one(ball);
}
}
printf("Yes\n");
return 0;
}
void to_one(int a[]){
for(int i = 0; i < 26; i++){
a[i] = 1;
}
}
Submission Info
| Submission Time | |
|---|---|
| Task | D - Scope |
| User | Cebu |
| Language | C (GCC 9.2.1) |
| Score | 0 |
| Code Size | 746 Byte |
| Status | WA |
| Exec Time | 2205 ms |
| Memory | 2208 KiB |
Compile Error
./Main.c: In function ‘main’:
./Main.c:8:2: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
8 | scanf("%s", str);
| ^~~~~~~~~~~~~~~~
Judge Result
| Set Name | Sample | All | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 0 / 400 | ||||||||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | example0.txt, example1.txt, example2.txt, example3.txt |
| All | example0.txt, example1.txt, example2.txt, example3.txt, random0.txt, random1.txt, random10.txt, random11.txt, random12.txt, random13.txt, random14.txt, random15.txt, random16.txt, random17.txt, random18.txt, random19.txt, random2.txt, random20.txt, random21.txt, random22.txt, random23.txt, random3.txt, random4.txt, random5.txt, random6.txt, random7.txt, random8.txt, random9.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| example0.txt | AC | 7 ms | 1512 KiB |
| example1.txt | WA | 2 ms | 1520 KiB |
| example2.txt | AC | 1 ms | 1596 KiB |
| example3.txt | WA | 1 ms | 1632 KiB |
| random0.txt | TLE | 2205 ms | 2064 KiB |
| random1.txt | TLE | 2205 ms | 2144 KiB |
| random10.txt | TLE | 2205 ms | 2128 KiB |
| random11.txt | TLE | 2205 ms | 2152 KiB |
| random12.txt | TLE | 2205 ms | 2132 KiB |
| random13.txt | TLE | 2205 ms | 2148 KiB |
| random14.txt | TLE | 2205 ms | 2152 KiB |
| random15.txt | TLE | 2205 ms | 2060 KiB |
| random16.txt | TLE | 2205 ms | 2208 KiB |
| random17.txt | TLE | 2205 ms | 2120 KiB |
| random18.txt | TLE | 2205 ms | 2160 KiB |
| random19.txt | WA | 298 ms | 1808 KiB |
| random2.txt | TLE | 2205 ms | 2204 KiB |
| random20.txt | WA | 186 ms | 1860 KiB |
| random21.txt | WA | 125 ms | 1912 KiB |
| random22.txt | WA | 164 ms | 1804 KiB |
| random23.txt | WA | 81 ms | 1840 KiB |
| random3.txt | TLE | 2205 ms | 2152 KiB |
| random4.txt | TLE | 2205 ms | 2164 KiB |
| random5.txt | AC | 9 ms | 1892 KiB |
| random6.txt | AC | 7 ms | 1908 KiB |
| random7.txt | AC | 10 ms | 1888 KiB |
| random8.txt | AC | 7 ms | 1908 KiB |
| random9.txt | AC | 8 ms | 1864 KiB |