Submission #953618
Source Code Expand
#include<stdio.h> #include<stdlib.h> #include<string.h> #include<math.h> #define sl(x) scanf("%ld", &x) #define ss(x) scanf("%s", x) #define pl(x) printf("%ld\n", x) #define INF 100000000000 #define M 1000000007 #define min(a,b) (((a)<(b))?(a):(b)) #define max(a,b) (((a)>(b))?(a):(b)) int main() { long N; char s[101]; char t[101]; int i, j; sl(N); ss(s); ss(t); for(i=0;i<N;i++) { for(j=0;j<N-i;j++) { if(t[j] != s[i+j]) break; } if(j == N - i) { pl(N + i); return 0; } } pl(2 * N); return 0; }
Submission Info
Submission Time | |
---|---|
Task | A - Prefix and Suffix |
User | Lhaplus |
Language | C (GCC 5.4.1) |
Score | 200 |
Code Size | 570 Byte |
Status | AC |
Exec Time | 1 ms |
Memory | 128 KB |
Compile Error
./Main.c: In function ‘main’: ./Main.c:6:15: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result] #define sl(x) scanf("%ld", &x) ^ ./Main.c:22:2: note: in expansion of macro ‘sl’ sl(N); ss(s); ss(t); ^ ./Main.c:7:15: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result] #define ss(x) scanf("%s", x) ^ ./Main.c:22:9: note: in expansion of macro ‘ss’ sl(N); ss(s); ss(t); ^ ./Main.c:7:15: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result] #define ss(x) scanf("%s", x) ^ ./Main.c:22:16: note: in expansion of macro ‘ss’ sl(N); ss(s); ss(t); ^
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 200 / 200 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | 0_00.txt, 0_01.txt, 0_02.txt |
All | 0_00.txt, 0_01.txt, 0_02.txt, 1_00.txt, 1_01.txt, 1_02.txt, 1_03.txt, 1_04.txt, 1_05.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
0_00.txt | AC | 1 ms | 128 KB |
0_01.txt | AC | 1 ms | 128 KB |
0_02.txt | AC | 1 ms | 128 KB |
1_00.txt | AC | 1 ms | 128 KB |
1_01.txt | AC | 1 ms | 128 KB |
1_02.txt | AC | 1 ms | 128 KB |
1_03.txt | AC | 1 ms | 128 KB |
1_04.txt | AC | 1 ms | 128 KB |
1_05.txt | AC | 1 ms | 128 KB |