QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#718078 | #9521. Giving Directions in Harbin | Rubt | WA | 0ms | 3536kb | C++14 | 785b | 2024-11-06 19:38:32 | 2024-11-06 19:38:33 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
const int N = 20;
int d[N];
char g[N];
int x[N];
// E S W N E S
// 1 2 3 4
char way[6] = { 'E', 'S', 'W', 'N', 'E', 'S' };
int main()
{
int t;
cin >> t;
while (t--)
{
int n, idx = 0;
cin >> n;
for (int i = 0; i < n; i++)
{
char k;
cin >> k >> x[i];
for (int j = 1; j < n; j++)
{
if (k == way[j])
d[i] = j;
}
}
g[0] = way[d[0]];
for (int i = 1; i < n; i++)
{
if (way[d[i]] == way[d[i - 1] - 1])
g[i] = 'L';
else if (way[d[i]] == way[d[i - 1] + 1])
g[i] = 'R';
}
cout << 2 * n + 1 << " ";
for (int i = 0; i < n; i++)
{
cout << g[i] << endl;
cout << 'Z' << " " << x[i] << endl;
}
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3536kb
input:
1 2 S 2 E 1
output:
5 S Z 2 L Z 1
result:
wrong output format Unexpected end of file - token expected (test case 1)