Submission #00073


ソースコード

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include<stdio.h>
#include<string.h>
int main(){
int n,x,y,i,j,k,l,cou=0,f=0;
scanf("%d %d %d",&n,&x,&y);
char s[n+1];
scanf("%s",s);
for(i=0;i<n-(x*2+y);i++){
f=0;
for(j=0;j<x;j++){
if(s[i+j]!=s[i+(x-1)-j]){
f++;
break;
}
}
for(k=0;k<y;k++){
if(s[i+x+k]!=s[i+(x+y-1)-k]){
f++;
break;
}
}
for(l=0;l<x;l++){
if(s[i+x+y+l]!=s[i+((x*2+y)-1)-l]){
f++;
}
}
if(f==0)cou++;
}
printf("%d\n",cou+1);
return(0);
}

ステータス

項目 データ
問題 0002 - 川柳 (Humorous Poem)
ユーザー名 ei1620
投稿日時 2016-12-07 18:52:15
言語 C
状態 Wrong Answer
得点 20
ソースコード長 528 Byte
最大実行時間 17 ms
最大メモリ使用量 444 KB

セット

セット 得点 Cases
1 INPUT1 0 / 20 *1.txt
2 INPUT2 0 / 20 *2.txt
3 INPUT3 0 / 20 *3.txt
4 INPUT4 0 / 20 *4.txt
5 INPUT5 20 / 20 *5.txt

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
2016-yo-t2-in1.txt WA 15 ms 380 KB
1
2016-yo-t2-in2.txt WA 17 ms 412 KB
2
2016-yo-t2-in3.txt WA 17 ms 380 KB
3
2016-yo-t2-in4.txt WA 16 ms 444 KB
4
2016-yo-t2-in5.txt AC 17 ms 348 KB
5