QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#563042 | #3946. Climbing Stairs | WeaRD276 | WA | 1ms | 3800kb | C++20 | 2.0kb | 2024-09-14 00:53:50 | 2024-09-14 00:53:51 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
template<class T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
template<class T>
using ordered_multiset = tree<T, null_type, less_equal<T>, rb_tree_tag, tree_order_statistics_node_update>;
#define FOR(i, a, b) for(int i = (a); i < (b); i++)
#define RFOR(i, a, b) for(int i = (a) - 1; i >= (b); i--)
#define SZ(a) int(a.size())
#define ALL(a) a.begin(), a.end()
#define RALL(a) a.rbegin(), a.rend()
#define PB push_back
#define MP make_pair
#define F first
#define S second
typedef long long ll;
typedef double db;
typedef vector<int> vi;
typedef vector<long long> vll;
typedef vector<double> vd;
typedef pair<int, int> pii;
typedef pair<double, double> pdd;
typedef pair<long long, long long> pll;
typedef vector<pair<int, int> > vpii;
typedef vector<pair<long long, long long> > vpll;
typedef set<int> si;
typedef set<long long> sll;
typedef map<int, int> mii;
typedef map<long long, long long> mll;
#ifdef ONPC
mt19937 rnd(228);
#else
mt19937 rnd(chrono::high_resolution_clock::now().time_since_epoch().count());
#endif
constexpr int INF = 1e9 + 47;
constexpr long long LINF = (ll) 1e18 + 4747;
constexpr int MOD = 998244353;
constexpr int N = 1e5 + 47;
int solve()
{
int n, r, k;
if (!(cin >> n >> r >> k))
return 1;
if (n & 1)
n++;
if (max(r, k) >= n)
{
cout << max(r, k) * 2 << '\n';
}
else
{
cout << n + r << '\n';
}
return 0;
}
int32_t main()
{
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
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
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 1ms
memory: 3732kb
input:
20 10 5
output:
30
result:
ok single line: '30'
Test #2:
score: 0
Accepted
time: 1ms
memory: 3608kb
input:
100 300 800
output:
1600
result:
ok single line: '1600'
Test #3:
score: 0
Accepted
time: 1ms
memory: 3576kb
input:
100 800 301
output:
1600
result:
ok single line: '1600'
Test #4:
score: 0
Accepted
time: 0ms
memory: 3728kb
input:
100 801 300
output:
1602
result:
ok single line: '1602'
Test #5:
score: 0
Accepted
time: 0ms
memory: 3720kb
input:
100 801 301
output:
1602
result:
ok single line: '1602'
Test #6:
score: 0
Accepted
time: 0ms
memory: 3728kb
input:
101 800 300
output:
1600
result:
ok single line: '1600'
Test #7:
score: 0
Accepted
time: 0ms
memory: 3668kb
input:
101 800 301
output:
1600
result:
ok single line: '1600'
Test #8:
score: 0
Accepted
time: 1ms
memory: 3668kb
input:
101 801 300
output:
1602
result:
ok single line: '1602'
Test #9:
score: 0
Accepted
time: 0ms
memory: 3708kb
input:
101 801 301
output:
1602
result:
ok single line: '1602'
Test #10:
score: 0
Accepted
time: 0ms
memory: 3616kb
input:
300 100 800
output:
1600
result:
ok single line: '1600'
Test #11:
score: 0
Accepted
time: 0ms
memory: 3656kb
input:
300 100 801
output:
1602
result:
ok single line: '1602'
Test #12:
score: 0
Accepted
time: 0ms
memory: 3720kb
input:
300 101 800
output:
1600
result:
ok single line: '1600'
Test #13:
score: 0
Accepted
time: 0ms
memory: 3724kb
input:
100 300 801
output:
1602
result:
ok single line: '1602'
Test #14:
score: 0
Accepted
time: 0ms
memory: 3592kb
input:
300 101 801
output:
1602
result:
ok single line: '1602'
Test #15:
score: 0
Accepted
time: 0ms
memory: 3800kb
input:
301 100 800
output:
1600
result:
ok single line: '1600'
Test #16:
score: 0
Accepted
time: 0ms
memory: 3596kb
input:
301 100 801
output:
1602
result:
ok single line: '1602'
Test #17:
score: 0
Accepted
time: 0ms
memory: 3732kb
input:
301 101 800
output:
1600
result:
ok single line: '1600'
Test #18:
score: 0
Accepted
time: 0ms
memory: 3724kb
input:
301 101 801
output:
1602
result:
ok single line: '1602'
Test #19:
score: 0
Accepted
time: 0ms
memory: 3656kb
input:
300 800 100
output:
1600
result:
ok single line: '1600'
Test #20:
score: 0
Accepted
time: 0ms
memory: 3720kb
input:
300 800 101
output:
1600
result:
ok single line: '1600'
Test #21:
score: 0
Accepted
time: 0ms
memory: 3720kb
input:
300 801 100
output:
1602
result:
ok single line: '1602'
Test #22:
score: 0
Accepted
time: 0ms
memory: 3716kb
input:
300 801 101
output:
1602
result:
ok single line: '1602'
Test #23:
score: 0
Accepted
time: 0ms
memory: 3716kb
input:
301 800 100
output:
1600
result:
ok single line: '1600'
Test #24:
score: 0
Accepted
time: 0ms
memory: 3652kb
input:
100 301 800
output:
1600
result:
ok single line: '1600'
Test #25:
score: 0
Accepted
time: 0ms
memory: 3656kb
input:
301 800 101
output:
1600
result:
ok single line: '1600'
Test #26:
score: 0
Accepted
time: 0ms
memory: 3788kb
input:
301 801 100
output:
1602
result:
ok single line: '1602'
Test #27:
score: 0
Accepted
time: 0ms
memory: 3644kb
input:
301 801 101
output:
1602
result:
ok single line: '1602'
Test #28:
score: 0
Accepted
time: 0ms
memory: 3668kb
input:
800 100 300
output:
900
result:
ok single line: '900'
Test #29:
score: 0
Accepted
time: 0ms
memory: 3676kb
input:
800 100 301
output:
900
result:
ok single line: '900'
Test #30:
score: -100
Wrong Answer
time: 0ms
memory: 3576kb
input:
800 101 300
output:
901
result:
wrong answer 1st lines differ - expected: '902', found: '901'