QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#560722#3946. Climbing StairsLaVuna47#WA 0ms3756kbC++171.9kb2024-09-12 17:31:472024-09-12 17:31:48

Judging History

This is the latest submission verdict.

  • [2024-09-12 17:31:48]
  • Judged
  • Verdict: WA
  • Time: 0ms
  • Memory: 3756kb
  • [2024-09-12 17:31:47]
  • Submitted

answer

/** gnu specific **/
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
/** contains everything I need in std **/
#include <bits/stdc++.h>

#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(S) ((int)S.size())
#define FOR(i, n) for(int i = 0; i < n; ++i)
#define RFOR(i, n) for(int i = n-1; i >= 0; --i)
#define output_vec(vec) { FOR(i_, sz(vec)) cout << vec[i_] << ' '; cout << '\n'; }
#define x first
#define y second
#define pb push_back
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
typedef unsigned long long ull;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;
typedef pair<double, double> pdd;
typedef vector<bool> vb;
typedef short si;
typedef unsigned long long ull;
typedef long double LD;
typedef pair<ull, ull> pull;
using namespace __gnu_pbds;
typedef tree<ll, null_type, less<>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
using namespace std;
#ifdef ONPC
mt19937 rnd(228);
#else
mt19937 rnd(chrono::high_resolution_clock::now().time_since_epoch().count());
#endif


int solve()
{
    ll n, r, k;
    if(!(cin >> n >> r >> k))
        return 1;
    if(r > k)
    {
        if(r >= n) cout << 2*r << '\n';
        else cout << (n + ((n-r)%2) + r) << '\n';
    }
    else
    {
        if(k+k-r >= n) cout << 2*k << '\n';
        else cout << (n+r + min(((n-r-k) % 2), min((n-r)%2, (n-k)%2))) << '\n';
    }
    return 0;
}

int32_t main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    int TET = 1e9;
    //cin >> TET;
    for (int i = 1; i <= TET; i++)
    {
        if (solve())
        {
            break;
        }
#ifdef ONPC
        cout << "__________________________" << endl;
#endif
    }
#ifdef ONPC
    cerr << endl << "finished in " << clock() * 1.0 / CLOCKS_PER_SEC << " sec" << endl;
#endif
}

详细

Test #1:

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

input:

20 10 5

output:

30

result:

ok single line: '30'

Test #2:

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

input:

100 300 800

output:

1600

result:

ok single line: '1600'

Test #3:

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

input:

100 800 301

output:

1600

result:

ok single line: '1600'

Test #4:

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

input:

100 801 300

output:

1602

result:

ok single line: '1602'

Test #5:

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

input:

100 801 301

output:

1602

result:

ok single line: '1602'

Test #6:

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

input:

101 800 300

output:

1600

result:

ok single line: '1600'

Test #7:

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

input:

101 800 301

output:

1600

result:

ok single line: '1600'

Test #8:

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

input:

101 801 300

output:

1602

result:

ok single line: '1602'

Test #9:

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

input:

101 801 301

output:

1602

result:

ok single line: '1602'

Test #10:

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

input:

300 100 800

output:

1600

result:

ok single line: '1600'

Test #11:

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

input:

300 100 801

output:

1602

result:

ok single line: '1602'

Test #12:

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

input:

300 101 800

output:

1600

result:

ok single line: '1600'

Test #13:

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

input:

100 300 801

output:

1602

result:

ok single line: '1602'

Test #14:

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

input:

300 101 801

output:

1602

result:

ok single line: '1602'

Test #15:

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

input:

301 100 800

output:

1600

result:

ok single line: '1600'

Test #16:

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

input:

301 100 801

output:

1602

result:

ok single line: '1602'

Test #17:

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

input:

301 101 800

output:

1600

result:

ok single line: '1600'

Test #18:

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

input:

301 101 801

output:

1602

result:

ok single line: '1602'

Test #19:

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

input:

300 800 100

output:

1600

result:

ok single line: '1600'

Test #20:

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

input:

300 800 101

output:

1600

result:

ok single line: '1600'

Test #21:

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

input:

300 801 100

output:

1602

result:

ok single line: '1602'

Test #22:

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

input:

300 801 101

output:

1602

result:

ok single line: '1602'

Test #23:

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

input:

301 800 100

output:

1600

result:

ok single line: '1600'

Test #24:

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

input:

100 301 800

output:

1600

result:

ok single line: '1600'

Test #25:

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

input:

301 800 101

output:

1600

result:

ok single line: '1600'

Test #26:

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

input:

301 801 100

output:

1602

result:

ok single line: '1602'

Test #27:

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

input:

301 801 101

output:

1602

result:

ok single line: '1602'

Test #28:

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

input:

800 100 300

output:

900

result:

ok single line: '900'

Test #29:

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

input:

800 100 301

output:

900

result:

ok single line: '900'

Test #30:

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

input:

800 101 300

output:

901

result:

wrong answer 1st lines differ - expected: '902', found: '901'