-
Notifications
You must be signed in to change notification settings - Fork 1
/
28682.cpp
42 lines (36 loc) · 877 Bytes
/
28682.cpp
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
#include <iostream>
#include <vector>
#include <cstdlib>
#include <string>
using namespace std;
void solve(void) {
int n;
cin >> n;
vector<vector<bool> > a(n, vector<bool>(3, false));
for (int i=0; i<n; i++) a[i][rand() % 3] = true;
for (int i=0; i<n; i++) {
if (a[i][0]) cout << "swimming ";
if (a[i][1]) cout << "bowling ";
if (a[i][2]) cout << "soccer ";
}
cout << "\n" << flush;
string s;
for (int i=0; i<n; i++) {
cin >> s;
if (s == "swimming") a[i][0] = true;
if (s == "bowling") a[i][1] = true;
if (s == "soccer") a[i][2] = true;
}
for (int i=0; i<n; i++) {
if (!a[i][0]) cout << "swimming ";
if (!a[i][1]) cout << "bowling ";
if (!a[i][2]) cout << "soccer ";
}
cout << "\n" << flush;
}
int main(void) {
ios::sync_with_stdio(false);
cin.tie(nullptr); cout.tie(nullptr);
solve();
return 0;
}