Submission #00076


ソースコード

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
32
33
#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)+1;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);
return(0);
}

ステータス

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

セット

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

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
2016-yo-t2-in1.txt AC 18 ms 380 KB
1
2016-yo-t2-in2.txt AC 20 ms 548 KB
2
2016-yo-t2-in3.txt AC 16 ms 388 KB
3
2016-yo-t2-in4.txt AC 15 ms 420 KB
4
2016-yo-t2-in5.txt AC 13 ms 480 KB
5