QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#430336#8687. Toy Train TracksMilanWA 1ms3744kbC++141.3kb2024-06-03 18:13:132024-06-03 18:13:13

Judging History

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

  • [2024-06-03 18:13:13]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3744kb
  • [2024-06-03 18:13:13]
  • 提交

answer

#include <bits/stdc++.h>
#define MULTI int _; cin >> _; while (_--)
#define fi first
#define se second
#define pb(a) push_back(a)
#define rep(i, n) for (int i = 0; i < n; i++)
#define reps(i, n, m) for (int i = n; i <= m; i++)
#define repsv(i, n, m) for (int i = n; i >= m; i--)
#define vsz(a) (int)(a.size())
#define mp(a, b) make_pair(a, b)
#define all(a) a.begin(), a.end()

using namespace std;

typedef pair<double, double> pdd;
typedef pair<int, int> pii;
typedef vector<bool> vb;
typedef vector<int> vi;
typedef long long int ll;
typedef long double ld;
typedef vector<ll> vll;

#ifdef LOCAL
#include "debugs.hpp"
#else
#define dbg(...) 0
#endif

void solve(){
    int s, c;
    cin >> s >> c;
    c -= 4;
    int b = c/4;
    int tl = 0, bl = 0;
    if(s < 2){
        tl = b/2;
        bl = b/2;
    }
    else{
        tl = (b+1)/2;
        bl = b/2;
    }
    int tls = 0, bls = 0;
    if(tl > bl){
        bls += 2;
        s -= 2;
    }
    tls += s/2;
    bls += s/2;
    cout << "LL";
    rep(i, tl)
        cout << "RLLR";
    rep(i, tls)
        cout << "S";
    cout << "LL";
    rep(i, bl)
        cout << "RLLR";
    rep(i, bls)
        cout << "S";
    cout << '\n';
}

int main(){
    ios_base::sync_with_stdio(false);
    // MULTI
    solve();
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

0 4

output:

LLLL

result:

ok correct, length = 4

Test #2:

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

input:

1 4

output:

LLLL

result:

ok correct, length = 4

Test #3:

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

input:

2 4

output:

LLSLLS

result:

ok correct, length = 6

Test #4:

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

input:

3 4

output:

LLSLLS

result:

ok correct, length = 6

Test #5:

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

input:

4 4

output:

LLSSLLSS

result:

ok correct, length = 8

Test #6:

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

input:

0 5

output:

LLLL

result:

ok correct, length = 4

Test #7:

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

input:

0 6

output:

LLLL

result:

ok correct, length = 4

Test #8:

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

input:

0 7

output:

LLLL

result:

ok correct, length = 4

Test #9:

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

input:

0 8

output:

LLLL

result:

ok correct, length = 4

Test #10:

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

input:

0 9

output:

LLLL

result:

ok correct, length = 4

Test #11:

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

input:

0 10

output:

LLLL

result:

ok correct, length = 4

Test #12:

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

input:

0 11

output:

LLLL

result:

ok correct, length = 4

Test #13:

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

input:

0 12

output:

LLRLLRLLRLLR

result:

ok correct, length = 12

Test #14:

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

input:

0 13

output:

LLRLLRLLRLLR

result:

ok correct, length = 12

Test #15:

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

input:

0 14

output:

LLRLLRLLRLLR

result:

ok correct, length = 12

Test #16:

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

input:

0 15

output:

LLRLLRLLRLLR

result:

ok correct, length = 12

Test #17:

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

input:

0 16

output:

LLRLLRLLRLLR

result:

wrong answer your plan is valid but your solution is not optimal (length of your loop = 12, length of jury's = 16