Submission #31274


ソースコード

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
#include<stdio.h>
#include<string.h>
int main() {
int n;
int i, j, k;
int ans = 0;
char word[100005];
char str[105];
char temp[105], buff[105];
scanf("%d %s", &n, word);
gets(buff);
for ( i = 0; i < n; i++) {
gets(str);
j = 0;
while( j < strlen(str)){
k = 0;
while(str[j] != ' ' && j < strlen(str)) {
temp[k] = str[j];
j++;
k++;
}
temp[k] = '\0';
if(strcmp(temp,word) == 0) {
ans++;
}
j++;
}
}
printf("%d\n", ans);
return (0);
}

ステータス

項目 データ
問題 0003 - 聖書
ユーザー名 ei1710
投稿日時 2018-02-17 12:56:51
言語 C++17
状態 Accepted
得点 5
ソースコード長 582 Byte
最大実行時間 51 ms
最大メモリ使用量 480 KB

セット

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

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
Alice_in1.txt AC 51 ms 480 KB
1
2
Alice_in2.txt AC 17 ms 464 KB
1
3
Alice_in3.txt AC 17 ms 440 KB
1