QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#560687 | #3946. Climbing Stairs | LaVuna47# | WA | 0ms | 3752kb | C++17 | 1.8kb | 2024-09-12 17:20:58 | 2024-09-12 17:21:03 |
Judging History
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 + ((n-r-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
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3580kb
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: 3692kb
input:
100 800 301
output:
1600
result:
ok single line: '1600'
Test #4:
score: 0
Accepted
time: 0ms
memory: 3640kb
input:
100 801 300
output:
1602
result:
ok single line: '1602'
Test #5:
score: 0
Accepted
time: 0ms
memory: 3540kb
input:
100 801 301
output:
1602
result:
ok single line: '1602'
Test #6:
score: 0
Accepted
time: 0ms
memory: 3620kb
input:
101 800 300
output:
1600
result:
ok single line: '1600'
Test #7:
score: 0
Accepted
time: 0ms
memory: 3708kb
input:
101 800 301
output:
1600
result:
ok single line: '1600'
Test #8:
score: 0
Accepted
time: 0ms
memory: 3696kb
input:
101 801 300
output:
1602
result:
ok single line: '1602'
Test #9:
score: 0
Accepted
time: 0ms
memory: 3612kb
input:
101 801 301
output:
1602
result:
ok single line: '1602'
Test #10:
score: 0
Accepted
time: 0ms
memory: 3752kb
input:
300 100 800
output:
1600
result:
ok single line: '1600'
Test #11:
score: 0
Accepted
time: 0ms
memory: 3612kb
input:
300 100 801
output:
1602
result:
ok single line: '1602'
Test #12:
score: 0
Accepted
time: 0ms
memory: 3612kb
input:
300 101 800
output:
1600
result:
ok single line: '1600'
Test #13:
score: 0
Accepted
time: 0ms
memory: 3696kb
input:
100 300 801
output:
1602
result:
ok single line: '1602'
Test #14:
score: 0
Accepted
time: 0ms
memory: 3744kb
input:
300 101 801
output:
1602
result:
ok single line: '1602'
Test #15:
score: 0
Accepted
time: 0ms
memory: 3620kb
input:
301 100 800
output:
1600
result:
ok single line: '1600'
Test #16:
score: 0
Accepted
time: 0ms
memory: 3704kb
input:
301 100 801
output:
1602
result:
ok single line: '1602'
Test #17:
score: 0
Accepted
time: 0ms
memory: 3552kb
input:
301 101 800
output:
1600
result:
ok single line: '1600'
Test #18:
score: 0
Accepted
time: 0ms
memory: 3700kb
input:
301 101 801
output:
1602
result:
ok single line: '1602'
Test #19:
score: 0
Accepted
time: 0ms
memory: 3648kb
input:
300 800 100
output:
1600
result:
ok single line: '1600'
Test #20:
score: 0
Accepted
time: 0ms
memory: 3748kb
input:
300 800 101
output:
1600
result:
ok single line: '1600'
Test #21:
score: 0
Accepted
time: 0ms
memory: 3624kb
input:
300 801 100
output:
1602
result:
ok single line: '1602'
Test #22:
score: 0
Accepted
time: 0ms
memory: 3620kb
input:
300 801 101
output:
1602
result:
ok single line: '1602'
Test #23:
score: 0
Accepted
time: 0ms
memory: 3556kb
input:
301 800 100
output:
1600
result:
ok single line: '1600'
Test #24:
score: 0
Accepted
time: 0ms
memory: 3744kb
input:
100 301 800
output:
1600
result:
ok single line: '1600'
Test #25:
score: 0
Accepted
time: 0ms
memory: 3640kb
input:
301 800 101
output:
1600
result:
ok single line: '1600'
Test #26:
score: 0
Accepted
time: 0ms
memory: 3672kb
input:
301 801 100
output:
1602
result:
ok single line: '1602'
Test #27:
score: 0
Accepted
time: 0ms
memory: 3636kb
input:
301 801 101
output:
1602
result:
ok single line: '1602'
Test #28:
score: 0
Accepted
time: 0ms
memory: 3624kb
input:
800 100 300
output:
900
result:
ok single line: '900'
Test #29:
score: -100
Wrong Answer
time: 0ms
memory: 3640kb
input:
800 100 301
output:
901
result:
wrong answer 1st lines differ - expected: '900', found: '901'