Submission #00200


ソースコード

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
#include <map>
#include <set>
#include <cmath>
#include <queue>
#include <stack>
#include <cctype>
#include <cstdio>
#include <string>
#include <vector>
#include <cstdlib>
#include <cstring>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <functional>
#define INF (2 << 28)
#define fr first
#define sc second
using namespace std;
typedef long long ll;
typedef pair<int, int> iP;
vector<string> split(string in){
string s;
vector <string> res;
istringstream ss(in);
while(getline(ss, s, ' ')){
res.push_back(s);
}
return res;
}
int main(){
int n, cnt = 0;
string c, s;
vector <string> div;
cin >> n >> c; cin.ignore();
for(int i = 0; i < n; i++){
getline(cin, s);
div = split(s);
for(vector<string>::iterator it = div.begin(); it != div.end(); it++){
if(*it == c) cnt++;
//cout << *it << endl;
}
}
cout<< cnt << endl;
}

ステータス

項目 データ
問題 0003 - 聖書
ユーザー名 Jogasaki_Mika_Tanto_P
投稿日時 2015-05-27 16:18:43
言語 C++11
状態 Accepted
得点 5
ソースコード長 967 Byte
最大実行時間 10 ms
最大メモリ使用量 544 KB

セット

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

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
Alice_in1.txt AC 9 ms 544 KB
1
2
Alice_in2.txt AC 10 ms 536 KB
1
3
Alice_in3.txt AC 9 ms 524 KB
1