Submission #08310


ソースコード

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
#include<stdio.h>
int main(){
char word[100000],s[100000];
int cnt=0;
int ans=0;
int temp;
int n;
int i,j,l;
scanf("%d %s",&n,word);
s[0]=32;
for(i=1;cnt<=n;i++){
scanf("%c",&s[i]);
if(s[i]==10){
cnt++;
}
}
for(j=1;j<i;j++){
if(word[0]==s[j]&&(s[j-1]==10||s[j-1]==32)){
temp=j;
for(l=0;word[l]!='\0'&&word[l]==s[temp+l];l++){
}
if(word[l]=='\0'&&(s[temp+l]==10||s[temp+l]==32)){
ans++;
}
}
}
printf("%d\n",ans);
return 0;
}

ステータス

項目 データ
問題 0003 - 聖書
ユーザー名 ei1630
投稿日時 2016-08-09 09:27:09
言語 C++11
状態 Accepted
得点 5
ソースコード長 538 Byte
最大実行時間 52 ms
最大メモリ使用量 604 KB

セット

セット 得点 Cases
1 ALL 3 / 3 *
2 SUB1 1 / 1 Alice_in1.txt
3 SUB2 1 / 1 Alice_in2.txt

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
Alice_in1.txt AC 34 ms 604 KB
1
2
Alice_in2.txt AC 52 ms 572 KB
1
3
Alice_in3.txt AC 19 ms 556 KB
1