Submission #37156372
Source Code Expand
#include <stdio.h>
#include <string.h>
int main(void){
char str[11];
scanf("%s", str);
int len = strlen(str);
int flag = 1;
if(len != 8){
flag = 0;
//printf("1\n");
}
else if(str[0] < 'A' || 'Z' < str[0]){
flag = 0;
//printf("2\n");
}
else{
for(int i = 0; i < len; i++){
str[i] = str[i+1];
}
int num = atoi(str);
if(num < 100000 || 999999 < num){
flag = 0;
//printf("3\n");
}
else if(str[6] < 'A' || 'Z' < str[6]){
flag = 0;
//printf("4\n");
}
}
if(flag){
printf("Yes\n");
}
else{
printf("No\n");
}
return 0;
}
Submission Info
| Submission Time | |
|---|---|
| Task | B - Sandwich Number |
| User | Cebu |
| Language | C (GCC 9.2.1) |
| Score | 200 |
| Code Size | 615 Byte |
| Status | AC |
| Exec Time | 4 ms |
| Memory | 1644 KiB |
Compile Error
./Main.c: In function ‘main’:
./Main.c:23:13: warning: implicit declaration of function ‘atoi’ [-Wimplicit-function-declaration]
23 | int num = atoi(str);
| ^~~~
./Main.c:6:2: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
6 | scanf("%s", str);
| ^~~~~~~~~~~~~~~~
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 200 / 200 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | 00_example_00.txt, 00_example_01.txt, 00_example_02.txt, 00_example_03.txt |
| All | 00_example_00.txt, 00_example_01.txt, 00_example_02.txt, 00_example_03.txt, 01_hand_00.txt, 01_hand_01.txt, 01_hand_02.txt, 01_hand_03.txt, 02_killer_00.txt, 02_killer_01.txt, 02_killer_02.txt, 02_killer_03.txt, 03_max_00.txt, 03_max_01.txt, 04_min_00.txt, 04_min_01.txt, 05_random_00.txt, 05_random_01.txt, 05_random_02.txt, 06_yes_00.txt, 06_yes_01.txt, 06_yes_02.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 00_example_00.txt | AC | 4 ms | 1568 KiB |
| 00_example_01.txt | AC | 1 ms | 1604 KiB |
| 00_example_02.txt | AC | 1 ms | 1548 KiB |
| 00_example_03.txt | AC | 1 ms | 1644 KiB |
| 01_hand_00.txt | AC | 1 ms | 1608 KiB |
| 01_hand_01.txt | AC | 1 ms | 1604 KiB |
| 01_hand_02.txt | AC | 2 ms | 1620 KiB |
| 01_hand_03.txt | AC | 1 ms | 1612 KiB |
| 02_killer_00.txt | AC | 1 ms | 1572 KiB |
| 02_killer_01.txt | AC | 1 ms | 1596 KiB |
| 02_killer_02.txt | AC | 1 ms | 1548 KiB |
| 02_killer_03.txt | AC | 1 ms | 1604 KiB |
| 03_max_00.txt | AC | 1 ms | 1552 KiB |
| 03_max_01.txt | AC | 1 ms | 1608 KiB |
| 04_min_00.txt | AC | 1 ms | 1512 KiB |
| 04_min_01.txt | AC | 1 ms | 1608 KiB |
| 05_random_00.txt | AC | 2 ms | 1636 KiB |
| 05_random_01.txt | AC | 1 ms | 1612 KiB |
| 05_random_02.txt | AC | 2 ms | 1548 KiB |
| 06_yes_00.txt | AC | 1 ms | 1580 KiB |
| 06_yes_01.txt | AC | 1 ms | 1576 KiB |
| 06_yes_02.txt | AC | 1 ms | 1604 KiB |