QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#713840#9521. Giving Directions in HarbinSMTTYWA 0ms3964kbC++14778b2024-11-05 20:41:062024-11-05 20:41:06

Judging History

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

  • [2024-11-05 20:41:06]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3964kb
  • [2024-11-05 20:41:06]
  • 提交

answer

#include<iostream>
#include<algorithm>
#include<cstring>
#include<map>

using namespace std;

typedef pair<char, char> PCC;

map<PCC, char> turn;

void solve(){
    int n, t, len;
    scanf("%d", &n);
    char last[2], now[2];
    printf("%d ", 2 * n - 1);
    n--;
    scanf("%s%d", last, &t);
    printf("%c\nZ %d\n", *last, t);
    while (n -- ){
        scanf("%s%d", now, &t);
        printf("%c\nZ %d\n", turn[{*last, *now}], t);
    }
}

int main(){
    turn[{'N', 'W'}] = 'L';
    turn[{'W', 'S'}] = 'L';
    turn[{'S', 'E'}] = 'L';
    turn[{'E', 'N'}] = 'L';
    turn[{'N', 'E'}] = 'R';
    turn[{'E', 'S'}] = 'R';
    turn[{'S', 'W'}] = 'R';
    turn[{'W', 'N'}] = 'R';
    int _;
    scanf("%d", &_);
    while (_ -- ) solve();
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3776kb

input:

1
2
S 2
E 1

output:

3 S
Z 2
L
Z 1

result:

ok ok (1 test case)

Test #2:

score: -100
Wrong Answer
time: 0ms
memory: 3964kb

input:

99
4
E 6
N 1
W 2
S 8
8
W 10
N 1
E 10
S 2
E 2
N 2
W 2
S 1
9
N 5
E 4
N 7
E 6
S 9
E 8
N 4
W 6
N 7
6
N 6
E 6
N 8
W 9
S 7
E 2
8
E 6
S 9
W 5
S 4
W 6
N 4
E 5
N 9
8
N 6
W 10
N 6
W 6
S 6
E 6
S 6
E 10
10
N 7
W 3
N 5
W 5
S 8
W 10
N 6
E 9
N 8
E 8
8
W 9
N 10
E 6
S 10
E 9
S 10
W 6
N 10
4
W 5
N 1
E 5
S 1
4
W 4
S 8...

output:

7 E
Z 6
L
Z 1

result:

wrong answer Token parameter [name=g] equals to "~", doesn't correspond to pattern "[ZLR]" (test case 1)