Submission #8993275
Source Code Expand
char buf[1<<17]; sz; A,B,N; main() { read(0,buf,1<<17); for(;;) { char k=buf[sz++]; if(k<'0')break; A=A*10+k-'0'; } for(;;) { char k=buf[sz++]; if(k<'0')break; B=B*10+k-'0'; } for(;;) { char k=buf[sz++]; if(k<'0')break; N=N*10+k-'0'; } for(int i=0;i<N;i++) { char k=buf[sz++]; if(k=='S'||k=='E'&&A>=B)A-=A>0; else B-=B>0; } printf("%d\n%d\n",A,B); }
Submission Info
Submission Time | |
---|---|
Task | B - 洋菓子店 |
User | kotatsugame |
Language | C (GCC 5.4.1) |
Score | 200 |
Code Size | 420 Byte |
Status | AC |
Exec Time | 1 ms |
Memory | 256 KB |
Compile Error
./Main.c:2:1: warning: data definition has no type or storage class sz; ^ ./Main.c:2:1: warning: type defaults to ‘int’ in declaration of ‘sz’ [-Wimplicit-int] ./Main.c:3:1: warning: data definition has no type or storage class A,B,N; ^ ./Main.c:3:1: warning: type defaults to ‘int’ in declaration of ‘A’ [-Wimplicit-int] ./Main.c:3:3: warning: type defaults to ‘int’ in declaration of ‘B’ [-Wimplicit-int] A,B,N; ^ ./Main.c:3:5: warning: type defaults to ‘int’ in declaration of ‘N’ [-Wimplicit-int] A,B,N; ^ ./Main.c:4:1: warning: return type defaults to ‘int’ [-Wimplicit-int] main() ^ ./Main.c: In function ‘main’: ./Main.c:6:2: warning: implicit declaration of function ‘read’ [-Wimplicit-function-declaration] read(0,buf,1<<17); ^ ./Main.c:31:2: warning: implicit declaration of function ‘printf’ [-Wimplicit-function-declaration] printf("%d\n%d\n",A,B); ^ ./Main.c:31:2: warning: incompatible implicit declaration of built-in function ‘printf’ ./Main.c:31:2: note: include ‘<stdio.h>’ o...
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 200 / 200 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample-01.txt, sample-02.txt, sample-03.txt, sample-04.txt |
All | 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, sample-01.txt, sample-02.txt, sample-03.txt, sample-04.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
01.txt | AC | 1 ms | 256 KB |
02.txt | AC | 1 ms | 256 KB |
03.txt | AC | 1 ms | 256 KB |
04.txt | AC | 1 ms | 256 KB |
05.txt | AC | 1 ms | 128 KB |
06.txt | AC | 1 ms | 256 KB |
07.txt | AC | 0 ms | 128 KB |
08.txt | AC | 0 ms | 128 KB |
sample-01.txt | AC | 0 ms | 128 KB |
sample-02.txt | AC | 0 ms | 128 KB |
sample-03.txt | AC | 0 ms | 128 KB |
sample-04.txt | AC | 0 ms | 128 KB |