-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdaily_trips.cpp
50 lines (43 loc) · 916 Bytes
/
daily_trips.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
43
44
45
46
47
48
49
50
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL):
#define all(x) x.begin(), x.end()
void solve(){
ll n, h, w;
cin >> n >> h >> w;
for(int i = 0; i < n; ++i){
char a, b;
cin >> a >> b;
char c='N', d='N';
if(a == 'Y') {
h--;
w++;
c = 'Y';
}
else if(a == 'N' and w == 0) {
h--;
w++;
c = 'Y';
}
if(b == 'Y') {
w--;
h++;
d = 'Y';
}
else if(b == 'N' and h == 0) {
w--;
h++;
d = 'Y';
}
cout << c << ' ' << d << '\n';
}
}
int main() {
int t; t=1;
// cin >> t;
for(int i = 0; i < t; ++i) {
solve();
}
}
// AC, implementation.