QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#448444#8687. Toy Train Tracksjames1BadCreeper#WA 1ms3700kbC++171.7kb2024-06-19 16:56:372024-06-19 16:56:38

Judging History

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

  • [2024-06-19 16:56:38]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3700kb
  • [2024-06-19 16:56:37]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;

int n, m; 

int main(void) {
    cin >> n >> m; 
    if (n % 2) --n; 
    if (m % 2) --m; 
    if (n == 0) {
        if (m % 4 == 2) m -= 2; 
        if (m == 8) m = 4; 
        if (m == 4) cout << "RRRR\n"; 
        else {
            cout << "RLRR"; 
            for (int i = 1; i <= (m - 8) / 4; ++i) cout << "LR"; 
            cout << "RLRR"; 
            for (int i = 1; i <= (m - 8) / 4; ++i) cout << "LR"; 
            cout << "\n"; 
        }
        return 0; 
    }
    if (m % 4 == 2) {
        // cout << "L"; 
        // cerr << n << " " << m << "\n"; 
        int op = n / 2; 
        for (int i = 1; i <= op; ++i) cout << "S"; 
        cout << "L"; 
        cout << "S"; 
        cout << "L"; 
        for (int i = 1; i < op; ++i) cout << "S"; 
        for (int i = 1; i <= (m - 6) / 4; ++i) cout << "RL"; 
        cout << "LRLL"; 
        for (int i = 1; i <= (m - 6) / 4; ++i) cout << "RL"; 
        cout << "\n"; 
        return 0; 
    }
    if (m == 4) {
        cout << "L"; 
        for (int i = 1; i <= n / 2; ++i) cout << "S"; 
        cout << "LL"; 
        for (int i = 1; i <= n / 2; ++i) cout << "S"; 
        cout << "L"; 
        cout << "\n"; 
        return 0; 
    }

    int op = n / 2; 
    for (int i = 1; i < op; ++i) cout << "S"; 
    cout << "L"; 
    cout << "SS"; 
    cout << "L"; 
    for (int i = 1; i < op; ++i) cout << "S"; 
    for (int i = 1; i <= (m - 6) / 4; ++i) cout << "RL"; 
    cout << "LRLL"; 
    int t = m - ((m - 6) / 2 + 6); 
    for (int i = 1; i <= t / 2; ++i) cout << "RL"; 
    cout << "\n"; 
    return 0;
}

/*
SSSLSSLSSSLRLLRLRL
SSSLSSLSSSLRLL
*/

详细

Test #1:

score: 100
Accepted
time: 1ms
memory: 3656kb

input:

0 4

output:

RRRR

result:

ok correct, length = 4

Test #2:

score: 0
Accepted
time: 1ms
memory: 3624kb

input:

1 4

output:

RRRR

result:

ok correct, length = 4

Test #3:

score: 0
Accepted
time: 0ms
memory: 3624kb

input:

2 4

output:

LSLLSL

result:

ok correct, length = 6

Test #4:

score: 0
Accepted
time: 1ms
memory: 3620kb

input:

3 4

output:

LSLLSL

result:

ok correct, length = 6

Test #5:

score: 0
Accepted
time: 1ms
memory: 3560kb

input:

4 4

output:

LSSLLSSL

result:

ok correct, length = 8

Test #6:

score: 0
Accepted
time: 1ms
memory: 3600kb

input:

0 5

output:

RRRR

result:

ok correct, length = 4

Test #7:

score: 0
Accepted
time: 1ms
memory: 3516kb

input:

0 6

output:

RRRR

result:

ok correct, length = 4

Test #8:

score: 0
Accepted
time: 0ms
memory: 3660kb

input:

0 7

output:

RRRR

result:

ok correct, length = 4

Test #9:

score: 0
Accepted
time: 1ms
memory: 3568kb

input:

0 8

output:

RRRR

result:

ok correct, length = 4

Test #10:

score: 0
Accepted
time: 1ms
memory: 3620kb

input:

0 9

output:

RRRR

result:

ok correct, length = 4

Test #11:

score: 0
Accepted
time: 1ms
memory: 3600kb

input:

0 10

output:

RRRR

result:

ok correct, length = 4

Test #12:

score: 0
Accepted
time: 1ms
memory: 3520kb

input:

0 11

output:

RRRR

result:

ok correct, length = 4

Test #13:

score: 0
Accepted
time: 1ms
memory: 3616kb

input:

0 12

output:

RLRRLRRLRRLR

result:

ok correct, length = 12

Test #14:

score: 0
Accepted
time: 0ms
memory: 3696kb

input:

0 13

output:

RLRRLRRLRRLR

result:

ok correct, length = 12

Test #15:

score: 0
Accepted
time: 0ms
memory: 3596kb

input:

0 14

output:

RLRRLRRLRRLR

result:

ok correct, length = 12

Test #16:

score: 0
Accepted
time: 0ms
memory: 3532kb

input:

0 15

output:

RLRRLRRLRRLR

result:

ok correct, length = 12

Test #17:

score: 0
Accepted
time: 0ms
memory: 3696kb

input:

0 16

output:

RLRRLRLRRLRRLRLR

result:

ok correct, length = 16

Test #18:

score: 0
Accepted
time: 1ms
memory: 3620kb

input:

0 17

output:

RLRRLRLRRLRRLRLR

result:

ok correct, length = 16

Test #19:

score: 0
Accepted
time: 0ms
memory: 3684kb

input:

0 18

output:

RLRRLRLRRLRRLRLR

result:

ok correct, length = 16

Test #20:

score: 0
Accepted
time: 1ms
memory: 3564kb

input:

0 19

output:

RLRRLRLRRLRRLRLR

result:

ok correct, length = 16

Test #21:

score: 0
Accepted
time: 0ms
memory: 3600kb

input:

0 20

output:

RLRRLRLRLRRLRRLRLRLR

result:

ok correct, length = 20

Test #22:

score: 0
Accepted
time: 0ms
memory: 3596kb

input:

0 21

output:

RLRRLRLRLRRLRRLRLRLR

result:

ok correct, length = 20

Test #23:

score: 0
Accepted
time: 1ms
memory: 3624kb

input:

0 22

output:

RLRRLRLRLRRLRRLRLRLR

result:

ok correct, length = 20

Test #24:

score: 0
Accepted
time: 0ms
memory: 3624kb

input:

0 23

output:

RLRRLRLRLRRLRRLRLRLR

result:

ok correct, length = 20

Test #25:

score: 0
Accepted
time: 0ms
memory: 3612kb

input:

0 24

output:

RLRRLRLRLRLRRLRRLRLRLRLR

result:

ok correct, length = 24

Test #26:

score: 0
Accepted
time: 1ms
memory: 3700kb

input:

0 25

output:

RLRRLRLRLRLRRLRRLRLRLRLR

result:

ok correct, length = 24

Test #27:

score: 0
Accepted
time: 0ms
memory: 3532kb

input:

0 26

output:

RLRRLRLRLRLRRLRRLRLRLRLR

result:

ok correct, length = 24

Test #28:

score: 0
Accepted
time: 0ms
memory: 3596kb

input:

0 27

output:

RLRRLRLRLRLRRLRRLRLRLRLR

result:

ok correct, length = 24

Test #29:

score: 0
Accepted
time: 1ms
memory: 3588kb

input:

0 28

output:

RLRRLRLRLRLRLRRLRRLRLRLRLRLR

result:

ok correct, length = 28

Test #30:

score: 0
Accepted
time: 0ms
memory: 3684kb

input:

0 29

output:

RLRRLRLRLRLRLRRLRRLRLRLRLRLR

result:

ok correct, length = 28

Test #31:

score: 0
Accepted
time: 0ms
memory: 3564kb

input:

0 30

output:

RLRRLRLRLRLRLRRLRRLRLRLRLRLR

result:

ok correct, length = 28

Test #32:

score: 0
Accepted
time: 1ms
memory: 3588kb

input:

5 5

output:

LSSLLSSL

result:

ok correct, length = 8

Test #33:

score: 0
Accepted
time: 0ms
memory: 3600kb

input:

6 6

output:

SSSLSLSSLRLL

result:

ok correct, length = 12

Test #34:

score: 0
Accepted
time: 0ms
memory: 3576kb

input:

7 7

output:

SSSLSLSSLRLL

result:

ok correct, length = 12

Test #35:

score: -100
Wrong Answer
time: 1ms
memory: 3592kb

input:

8 8

output:

SSSLSSLSSSLRLL

result:

wrong answer your loop is not closed