QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#718078#9521. Giving Directions in HarbinRubtWA 0ms3536kbC++14785b2024-11-06 19:38:322024-11-06 19:38:33

Judging History

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

  • [2024-11-06 19:38:33]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3536kb
  • [2024-11-06 19:38:32]
  • 提交

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)