QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#563044 | #3946. Climbing Stairs | WeaRD276 | WA | 0ms | 3672kb | C++20 | 2.1kb | 2024-09-14 00:54:53 | 2024-09-14 00:54:53 |
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 (r & 1)
r++;
if (k & 1)
k++;
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: 0ms
memory: 3668kb
input:
20 10 5
output:
30
result:
ok single line: '30'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3672kb
input:
100 300 800
output:
1600
result:
ok single line: '1600'
Test #3:
score: 0
Accepted
time: 0ms
memory: 3624kb
input:
100 800 301
output:
1600
result:
ok single line: '1600'
Test #4:
score: -100
Wrong Answer
time: 0ms
memory: 3660kb
input:
100 801 300
output:
1604
result:
wrong answer 1st lines differ - expected: '1602', found: '1604'