Submission #00077


ソースコード

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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#include<bits/stdc++.h>
using namespace std;
int main(){
long long int a,b,c,jud1,ans=0;
cin >> a >> b >> c;
jud1=2*b+c;
string s1[6],s2[1],s3[1],s4[1];
cin >> s1[0];
for(long long int i=0;i<a-(jud1-1);i++){
for(long long int j=i;j<jud1+i-1;j++){
if( j < b+i ){
s1[1]+=s1[0][j];
} else if(j < c+b+i){
s1[2]+=s1[0][j];
}
}
for(long long int j=0;j<b;j++){
s1[3]+=s1[0][i+jud1-1-j];
}
//cout << s1[1] << endl;
//cout << s1[2] << endl;
//cout << s1[3] << endl;
s2[0]=s1[1];
s3[0]=s1[2];
s4[0]=s1[3];
if(s2[0].size() != 1){
reverse(s2[0].begin(),s2[0].end());
}
if(s3[0].size() != 1){
reverse(s3[0].begin(),s3[0].end());
}
if(s4[0].size() != 1){
reverse(s4[0].begin(),s4[0].end());
}
if(s1[1] == s2[0] && s1[2] == s3[0] && s1[3] == s4[0]){
ans++;
//cout << s2 << endl;
//cout << s3 << endl;
//cout << s4 << endl;
}
s1[1]=s1[4];
s1[2]=s1[4];
s1[3]=s1[4];
}
cout << ans << endl;
return 0;
}

ステータス

項目 データ
問題 0002 - 川柳 (Humorous Poem)
ユーザー名 ei1612
投稿日時 2016-12-07 18:53:52
言語 C++11
状態 Accepted
得点 100
ソースコード長 1155 Byte
最大実行時間 26 ms
最大メモリ使用量 528 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 14 ms 480 KB
1
2016-yo-t2-in2.txt AC 26 ms 468 KB
2
2016-yo-t2-in3.txt AC 17 ms 448 KB
3
2016-yo-t2-in4.txt AC 19 ms 424 KB
4
2016-yo-t2-in5.txt AC 20 ms 528 KB
5