QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#418838 | #8687. Toy Train Tracks | by_chance# | WA | 0ms | 3860kb | C++14 | 1.5kb | 2024-05-23 16:03:06 | 2024-05-23 16:03:07 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
int a,b;
int main(){
scanf("%d%d",&a,&b);a=a/2*2;b=b/2*2;
if(a==0){
b=b/4*4;if(b==8)b=4;
if(b==4)printf("RRRR\n");
else{
printf("RLRR\n");for(int i=1;i<=b/4-2;i++)printf("LR");
printf("RLRR\n");for(int i=1;i<=b/4-2;i++)printf("LR");
}
}
else{
if(b==4){
printf("RR");for(int i=1;i<=a/2;i++)printf("S");
printf("RR");for(int i=1;i<=a/2;i++)printf("S");
}
else if(b==6){
printf("SRSRRL");for(int i=1;i<=a/2-1;i++)printf("S");
printf("RR");for(int i=1;i<=a/2-1;i++)printf("S");
}
else if(b==8){
printf("SSRRLRRL");for(int i=1;i<=a/2-1;i++)printf("S");
printf("RR");for(int i=1;i<=a/2-1;i++)printf("S");
}
else if(b==10){
printf("LRLRRSRLRS");for(int i=1;i<=a/2-1;i++)printf("S");
printf("RR");for(int i=1;i<=a/2-1;i++)printf("S");
}
else{
for(int i=1;i<=b/4-2;i++)printf("LR");printf("RLRR");
for(int i=1;i<=b/4-2;i++)printf("LR");printf("RL");
if(b%4==0){
for(int i=1;i<=a/2;i++)printf("S");printf("RR");
for(int i=1;i<=a/2;i++)printf("S");
}
else{
for(int i=1;i<=a/2-1;i++)printf("S");printf("LRRSRS");
for(int i=1;i<=a/2-1;i++)printf("S");
}
}
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3680kb
input:
0 4
output:
RRRR
result:
ok correct, length = 4
Test #2:
score: 0
Accepted
time: 0ms
memory: 3860kb
input:
1 4
output:
RRRR
result:
ok correct, length = 4
Test #3:
score: 0
Accepted
time: 0ms
memory: 3852kb
input:
2 4
output:
RRSRRS
result:
ok correct, length = 6
Test #4:
score: 0
Accepted
time: 0ms
memory: 3728kb
input:
3 4
output:
RRSRRS
result:
ok correct, length = 6
Test #5:
score: 0
Accepted
time: 0ms
memory: 3788kb
input:
4 4
output:
RRSSRRSS
result:
ok correct, length = 8
Test #6:
score: 0
Accepted
time: 0ms
memory: 3860kb
input:
0 5
output:
RRRR
result:
ok correct, length = 4
Test #7:
score: 0
Accepted
time: 0ms
memory: 3856kb
input:
0 6
output:
RRRR
result:
ok correct, length = 4
Test #8:
score: 0
Accepted
time: 0ms
memory: 3680kb
input:
0 7
output:
RRRR
result:
ok correct, length = 4
Test #9:
score: 0
Accepted
time: 0ms
memory: 3728kb
input:
0 8
output:
RRRR
result:
ok correct, length = 4
Test #10:
score: 0
Accepted
time: 0ms
memory: 3656kb
input:
0 9
output:
RRRR
result:
ok correct, length = 4
Test #11:
score: 0
Accepted
time: 0ms
memory: 3748kb
input:
0 10
output:
RRRR
result:
ok correct, length = 4
Test #12:
score: 0
Accepted
time: 0ms
memory: 3852kb
input:
0 11
output:
RRRR
result:
ok correct, length = 4
Test #13:
score: -100
Wrong Answer
time: 0ms
memory: 3736kb
input:
0 12
output:
RLRR LRRLRR LR
result:
wrong answer your loop is not closed