QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#711690 | #9521. Giving Directions in Harbin | 2018haha# | WA | 0ms | 3704kb | C++14 | 719b | 2024-11-05 13:03:10 | 2024-11-05 13:03:12 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
int s[20],a[20];
char c[5]={'N','E','S','W'};
//n e s w
int main(){
ios::sync_with_stdio(false);
int t;
cin>>t;
while(t--){
int n;
cin>>n;
char d,f;
for(int i=0;i<n;i++){
cin>>d>>a[i];
if(d=='N') s[i]=1;
else if(d=='E') s[i]=2;
else if(d=='S') s[i]=3;
else s[i]=4;
}
cout<<n*2-1<<' '<<c[0]<<endl;
for(int i=0;i<n;i++){
cout<<"Z "<<a[i]<<endl;
if(i==(n-1)) break;
if((s[i+1]-s[i])==1||(s[i]==4&&s[i+1]==1)) cout<<"R"<<endl;
else cout<<"L"<<endl;
}
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3704kb
input:
1 2 S 2 E 1
output:
3 N Z 2 L Z 1
result:
wrong answer Wrong destination (test case 1)