QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#711690#9521. Giving Directions in Harbin2018haha#WA 0ms3704kbC++14719b2024-11-05 13:03:102024-11-05 13:03:12

Judging History

你现在查看的是最新测评结果

  • [2024-11-05 13:03:12]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3704kb
  • [2024-11-05 13:03:10]
  • 提交

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;

        }
    }
}

詳細信息

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)