QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#701072 | #9521. Giving Directions in Harbin | klhwong# | WA | 0ms | 3696kb | C++17 | 1.1kb | 2024-11-02 13:43:26 | 2024-11-02 13:43:27 |
Judging History
answer
#include <bits/stdc++.h>
#define int long long
using namespace std;
int t{};
int n{}, x{};
char d{};
int getDir(char c) {
if (c == 'N') {
return 0;
} else if (c == 'E') {
return 1;
} else if (c == 'S') {
return 2;
} else {
return 3;
}
}
signed main() {
ios::sync_with_stdio(0), cin.tie(0);
cin >> t;
while(t--) {
cin >> n;
vector<pair<char, int>> answer;
int prevDir, curDir;
for (int i = 0; i < n; i++) {
cin >> d >> x;
curDir = getDir(d);
if (i == 0) {
cout << (n - 1) * 2 + 1 << ' ' << curDir << '\n';
cout << 'Z' << ' ' << x << '\n';
} else {
if (curDir == (prevDir + 1) % 4) {
cout << 'R' << '\n';
cout << 'Z' << ' ' << x << '\n';
} else {
cout << 'L' << '\n';
cout << 'Z' << ' ' << x << '\n';
}
}
prevDir = curDir;
}
}
}
詳細信息
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3696kb
input:
1 2 S 2 E 1
output:
3 2 Z 2 L Z 1
result:
wrong answer Token parameter [name=f] equals to "2", doesn't correspond to pattern "[NSWE]" (test case 1)