QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#709823 | #9525. Welcome to Join the Online Meeting! | 0x3fffffff | WA | 0ms | 3540kb | C++23 | 1.3kb | 2024-11-04 16:59:56 | 2024-11-04 17:00:00 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
struct node {
char op;
int x;
};
void solve() {
int n;
cin >> n;
vector<node>a(n + 1);
for (int i = 1;i <= n;i++) {
cin >> a[i].op >> a[i].x;
}
auto get = [&](char x, char y) {
if (x == 'N' and y == 'E')return 'R';
if (x == 'N' and y == 'W')return 'L';
if (x == 'E' and y == 'S')return 'R';
if (x == 'E' and y == 'N')return 'L';
if (x == 'S' and y == 'W')return 'R';
if (x == 'S' and y == 'E')return 'L';
if (x == 'W' and y == 'N')return 'R';
if (x == 'W' and y == 'S')return 'L';
return 'L';
};
vector<node>ans;
ans.push_back({ 'Z',a[1].x });
for (int i = 2;i <= n;i++) {
ans.push_back({ get(a[i - 1].op,a[i].op),-1 });
ans.push_back({ 'Z',a[i].x });
}
cout << ans.size() << " " << a[1].op << "\n";
for (auto [x, y] : ans) {
if (y == -1) {
cout << x << "\n";
}
else {
cout << x << " " << y << "\n";
}
}
}
signed main() {
ios::sync_with_stdio(0);
cin.tie(0);
int T = 1;
#ifdef LOCAL
freopen("data.in", "r", stdin);
freopen("data.out", "w", stdout);
#endif
cin >> T;
while (T--)
solve();
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3540kb
input:
4 5 2 3 4 1 2 1 3 2 3 3 4 2 4
output:
9 2 Z 3 L Z 1 L Z 1 L Z 2 L Z 3 7 2 Z 4 L Z 0 L Z 0 L Z 0 7
result:
wrong answer Token parameter [name=pans] equals to "9", doesn't correspond to pattern "Yes|No"