QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#448428#8687. Toy Train Tracksjames1BadCreeper#WA 1ms3700kbC++171.3kb2024-06-19 16:45:042024-06-19 16:45:04

Judging History

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

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

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"; 
        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; 
    }

    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"; 
    for (int i = 1; i <= (m - 6) / 4; ++i) cout << "RL"; 
    cout << "\n"; 
    return 0;
}

詳細信息

Test #1:

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

input:

0 4

output:

RRRR

result:

ok correct, length = 4

Test #2:

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

input:

1 4

output:

RRRR

result:

ok correct, length = 4

Test #3:

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

input:

2 4

output:

LSSLLRLL

result:

wrong answer your loop is not closed