-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathC.cpp
More file actions
31 lines (30 loc) · 715 Bytes
/
C.cpp
File metadata and controls
31 lines (30 loc) · 715 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
29
30
31
#include <stdio.h>
#include <string.h>
int main(){
int t;
scanf("%d",&t);
int copy = t;
int n;
while(copy--){
scanf("%d",&n);
int numf[n];
for(int i=0;i<n;i++)
scanf("%d",&numf[i]);
for(int i=0;i<n;i++){
int cnt;
scanf("%d",&cnt);
char ch,chnull;
scanf("%c",&chnull);
for(int j=0;j<cnt;j++){
scanf("%c",&ch);
if(ch=='D')
numf[i] = numf[i]+1;
if(ch=='U')
numf[i] = numf[i]-1;
}
}
for(int k=0;k<n;k++)
printf("%d ",((10+numf[k])%10));
printf("\n");
}
}