QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#692788 | #5416. Fabulous Fungus Frenzy | xiey# | WA | 0ms | 3656kb | C++20 | 2.5kb | 2024-10-31 15:02:50 | 2024-10-31 15:02:50 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define ll long long
#define ull unsigned long long
const int MOD = 1e9 + 7;
const int N = 3005;
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int t;
cin >> t;
while (t--)
{
int n;
cin >> n;
char c;
int b;
int x = 0, y = 0;
for (int i = 0; i < n; i++)
{
cin >> c >> b;
if (c == 'N')
{
y += b;
}
if (c == 'S')
{
y -= b;
}
if (c == 'E')
{
x += b;
}
if (c == 'W')
{
x -= b;
}
}
if (x > 0)
{
if (y == 0)
{
cout << 1 << " E" << endl;
cout << "Z" << " " << x << endl;
}
else
{
cout << 3 << " E" << endl;
cout << "Z" << " " << x << endl;
if (y > 0)
cout << "L" << endl;
else
cout << "R" << endl;
cout << "Z" << " " << abs(y) << endl;
}
}
else if (x < 0)
{
if (y == 0)
{
cout << 1 << " W" << endl;
cout << "Z" << " " << -x << endl;
}
else
{
cout << 3 << " W" << endl;
cout << "Z" << " " << -x << endl;
if (y > 0)
cout << "R" << endl;
else
cout << "L" << endl;
cout << "Z" << " " << abs(y) << endl;
}
}
else if (x == 0)
{
if (y == 0)
{
cout << 7 << " E" << endl;
cout << "Z" << " " << 1 << endl;
cout << "L" << endl;
cout << "Z" << " " << 1 << endl;
cout << "L" << endl;
cout << "Z" << " " << 1 << endl;
cout << "L" << endl;
cout << "Z" << " " << 1 << endl;
}
else
{
if (y > 0)
cout << 1 << " N" << endl;
else
cout << 1 << " S" << endl;
cout << "Z" << " " << abs(y) << endl;
}
}
}
return 0;
}
詳細信息
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3656kb
input:
3 3 1 OOO GOG BGB OOO GGG BBB 3 1 B G B
output:
7 E Z 1 L Z 1 L Z 1 L Z 1 7 E Z 1 L Z 1 L Z 1 L Z 1 7 E Z 1 L Z 1 L Z 1 L Z 1
result:
wrong output format Expected integer, but "E" found