QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#448436 | #8687. Toy Train Tracks | james1BadCreeper# | WA | 1ms | 3700kb | C++17 | 1.6kb | 2024-06-19 16:51:16 | 2024-06-19 16:51:17 |
Judging History
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";
for (int i = 1; i <= (m - 6) / 4; ++i) cout << "RL";
cout << "\n";
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 1ms
memory: 3516kb
input:
0 4
output:
RRRR
result:
ok correct, length = 4
Test #2:
score: 0
Accepted
time: 1ms
memory: 3684kb
input:
1 4
output:
RRRR
result:
ok correct, length = 4
Test #3:
score: 0
Accepted
time: 1ms
memory: 3616kb
input:
2 4
output:
LSLLSL
result:
ok correct, length = 6
Test #4:
score: 0
Accepted
time: 1ms
memory: 3584kb
input:
3 4
output:
LSLLSL
result:
ok correct, length = 6
Test #5:
score: 0
Accepted
time: 0ms
memory: 3696kb
input:
4 4
output:
LSSLLSSL
result:
ok correct, length = 8
Test #6:
score: 0
Accepted
time: 0ms
memory: 3696kb
input:
0 5
output:
RRRR
result:
ok correct, length = 4
Test #7:
score: 0
Accepted
time: 0ms
memory: 3596kb
input:
0 6
output:
RRRR
result:
ok correct, length = 4
Test #8:
score: 0
Accepted
time: 0ms
memory: 3600kb
input:
0 7
output:
RRRR
result:
ok correct, length = 4
Test #9:
score: 0
Accepted
time: 1ms
memory: 3620kb
input:
0 8
output:
RRRR
result:
ok correct, length = 4
Test #10:
score: 0
Accepted
time: 1ms
memory: 3524kb
input:
0 9
output:
RRRR
result:
ok correct, length = 4
Test #11:
score: 0
Accepted
time: 1ms
memory: 3684kb
input:
0 10
output:
RRRR
result:
ok correct, length = 4
Test #12:
score: 0
Accepted
time: 1ms
memory: 3556kb
input:
0 11
output:
RRRR
result:
ok correct, length = 4
Test #13:
score: 0
Accepted
time: 0ms
memory: 3592kb
input:
0 12
output:
RLRRLRRLRRLR
result:
ok correct, length = 12
Test #14:
score: 0
Accepted
time: 1ms
memory: 3612kb
input:
0 13
output:
RLRRLRRLRRLR
result:
ok correct, length = 12
Test #15:
score: 0
Accepted
time: 1ms
memory: 3616kb
input:
0 14
output:
RLRRLRRLRRLR
result:
ok correct, length = 12
Test #16:
score: 0
Accepted
time: 0ms
memory: 3560kb
input:
0 15
output:
RLRRLRRLRRLR
result:
ok correct, length = 12
Test #17:
score: 0
Accepted
time: 1ms
memory: 3636kb
input:
0 16
output:
RLRRLRLRRLRRLRLR
result:
ok correct, length = 16
Test #18:
score: 0
Accepted
time: 1ms
memory: 3684kb
input:
0 17
output:
RLRRLRLRRLRRLRLR
result:
ok correct, length = 16
Test #19:
score: 0
Accepted
time: 0ms
memory: 3616kb
input:
0 18
output:
RLRRLRLRRLRRLRLR
result:
ok correct, length = 16
Test #20:
score: 0
Accepted
time: 0ms
memory: 3696kb
input:
0 19
output:
RLRRLRLRRLRRLRLR
result:
ok correct, length = 16
Test #21:
score: 0
Accepted
time: 1ms
memory: 3688kb
input:
0 20
output:
RLRRLRLRLRRLRRLRLRLR
result:
ok correct, length = 20
Test #22:
score: 0
Accepted
time: 1ms
memory: 3612kb
input:
0 21
output:
RLRRLRLRLRRLRRLRLRLR
result:
ok correct, length = 20
Test #23:
score: 0
Accepted
time: 1ms
memory: 3700kb
input:
0 22
output:
RLRRLRLRLRRLRRLRLRLR
result:
ok correct, length = 20
Test #24:
score: 0
Accepted
time: 1ms
memory: 3696kb
input:
0 23
output:
RLRRLRLRLRRLRRLRLRLR
result:
ok correct, length = 20
Test #25:
score: 0
Accepted
time: 1ms
memory: 3696kb
input:
0 24
output:
RLRRLRLRLRLRRLRRLRLRLRLR
result:
ok correct, length = 24
Test #26:
score: 0
Accepted
time: 1ms
memory: 3696kb
input:
0 25
output:
RLRRLRLRLRLRRLRRLRLRLRLR
result:
ok correct, length = 24
Test #27:
score: 0
Accepted
time: 0ms
memory: 3696kb
input:
0 26
output:
RLRRLRLRLRLRRLRRLRLRLRLR
result:
ok correct, length = 24
Test #28:
score: 0
Accepted
time: 1ms
memory: 3620kb
input:
0 27
output:
RLRRLRLRLRLRRLRRLRLRLRLR
result:
ok correct, length = 24
Test #29:
score: 0
Accepted
time: 0ms
memory: 3684kb
input:
0 28
output:
RLRRLRLRLRLRLRRLRRLRLRLRLRLR
result:
ok correct, length = 28
Test #30:
score: 0
Accepted
time: 0ms
memory: 3624kb
input:
0 29
output:
RLRRLRLRLRLRLRRLRRLRLRLRLRLR
result:
ok correct, length = 28
Test #31:
score: 0
Accepted
time: 1ms
memory: 3564kb
input:
0 30
output:
RLRRLRLRLRLRLRRLRRLRLRLRLRLR
result:
ok correct, length = 28
Test #32:
score: 0
Accepted
time: 0ms
memory: 3688kb
input:
5 5
output:
LSSLLSSL
result:
ok correct, length = 8
Test #33:
score: 0
Accepted
time: 1ms
memory: 3692kb
input:
6 6
output:
SSSLSLSSLRLL
result:
ok correct, length = 12
Test #34:
score: 0
Accepted
time: 1ms
memory: 3692kb
input:
7 7
output:
SSSLSLSSLRLL
result:
ok correct, length = 12
Test #35:
score: -100
Wrong Answer
time: 1ms
memory: 3624kb
input:
8 8
output:
SSSLSSLSSSLRLL
result:
wrong answer your loop is not closed