forked from DionysiosB/CodeForces
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1703C-Cypher.cpp
More file actions
28 lines (23 loc) · 742 Bytes
/
Copy path1703C-Cypher.cpp
File metadata and controls
28 lines (23 loc) · 742 Bytes
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
#include <iostream>
#include <vector>
int main(){
std::ios_base::sync_with_stdio(false);
long t; std::cin >> t;
while(t--){
long n; std::cin >> n;
std::vector<int> v(n); for(long p = 0; p < n; p++){std::cin >> v[p];}
for(long p = 0; p < n; p++){
long x; std::cin >> x;
std::string s; std::cin >> s;
long cnt(0);
for(long q = 0; q < s.size(); q++){
if(s[q] == 'D'){++cnt;}
else if(s[q] == 'U'){--cnt;}
}
cnt = ((cnt % 10) + 10) % 10;
v[p] += cnt; v[p] = (v[p] + 10) % 10;
}
for(long p = 0; p < n; p++){std::cout << v[p] << " ";}
std::cout << std::endl;
}
}