QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#472809#8687. Toy Train TracksGodwangWA 0ms3692kbC++142.6kb2024-07-11 19:28:562024-07-11 19:28:57

Judging History

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

  • [2024-07-11 19:28:57]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3692kb
  • [2024-07-11 19:28:56]
  • 提交

answer

#include <iostream>
using namespace std;
#include <set>
#include <algorithm>
#include <cmath>
#include <map>
#include <cstdio>
#include <string>
#include <cstring>
#include <string.h>
#include <stdlib.h>
#include <iomanip>
#include <fstream>
#include <stdio.h>
#include <stack>
#include <queue>
#include <ctype.h>
#include <vector>
#include <random>
#include <bitset>
#define ll long long
#define ull unsigned long long
#define pb push_back
#define rep(i, a, n) for (int i = a; i <= n; i++)
#define per(i, a, n) for (int i = n; i >= a; i--)
#define pii pair<int, int>
#define pli pair<ll, int>
#define pil pair<int, ll>
#define pll pair<ll, ll>

const ll inf = 1000000000000000000ll;
const ll mod = 1e9 + 7, P1 = 13331;
const double eps = 1e-7;
const int N = 4e5 + 10, M = 1e4 + 10;

int s,c;

void zuo()
{
    cout<<"L";
}

void you()
{
    cout<<"R";
}

void zhi()
{
    cout<<"S";
}

int main()
{
    ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    //freopen("ain.txt", "r", stdin);freopen("aout.txt", "w", stdout);
    cin>>s>>c;
    
    if(s%2==1)
    {
        s--;
    }
    if(c%2==1)
    {
        c--;
    }

    if(c==8&&s<2)
    {
        c=4;
    }

    if(c%4!=0&&s<2)
    {
        c-=2;
    }

    if(c==4)
    {
        you();
        you();
        rep(i,1,s/2)
        {
            zhi();
        }
        you();you();
        rep(i,1,s/2)
        {
            zhi();
        }
    }
    else if(c==8)
    {
        you();you();zuo();you();
        you();zuo();
        s-=2;
        rep(i,1,s/2)
        {
            zhi();
        }
        you();
        you();
        rep(i,1,s/2)
        {
            zhi();
        }
        zhi();
        zhi();
    }
    else if(c%4==0)
    {
        you();zuo();you();you();zuo();
        rep(i,1,s/2)
        {
            zhi();
        }
        you();you();
        rep(i,1,s/2)
        {
            zhi();
        }
        zuo();
        rep(i,1,(c-12)/4)
        {
            you();zuo();
        }
        you();you();zuo();you();
        rep(i,1,(c-12)/4)
        {
            you();zuo();
        }
    }
    else
    {
        zhi();
        s-=2;
        rep(i,1,s/2)
        {
            zhi();
        }
        zuo();zhi();zuo();
        rep(i,1,s/2)
        {
            zhi();
        }
        rep(i,1,(c-6)/4)
        {
            you();zuo();
        }
        zuo();you();zuo();zuo();
        rep(i,1,(c-6)/4)
        {
            you();zuo();
        }
    }
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

0 4

output:

RRRR

result:

ok correct, length = 4

Test #2:

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

input:

1 4

output:

RRRR

result:

ok correct, length = 4

Test #3:

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

input:

2 4

output:

RRSRRS

result:

ok correct, length = 6

Test #4:

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

input:

3 4

output:

RRSRRS

result:

ok correct, length = 6

Test #5:

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

input:

4 4

output:

RRSSRRSS

result:

ok correct, length = 8

Test #6:

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

input:

0 5

output:

RRRR

result:

ok correct, length = 4

Test #7:

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

input:

0 6

output:

RRRR

result:

ok correct, length = 4

Test #8:

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

input:

0 7

output:

RRRR

result:

ok correct, length = 4

Test #9:

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

input:

0 8

output:

RRRR

result:

ok correct, length = 4

Test #10:

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

input:

0 9

output:

RRRR

result:

ok correct, length = 4

Test #11:

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

input:

0 10

output:

RRLRRLRRSS

result:

FAIL what?! your plan is better than the optimal plan?