QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#563047#3946. Climbing StairsWeaRD276AC ✓1ms3756kbC++202.1kb2024-09-14 00:56:592024-09-14 00:56:59

Judging History

This is the latest submission verdict.

  • [2024-09-14 00:56:59]
  • Judged
  • Verdict: AC
  • Time: 1ms
  • Memory: 3756kb
  • [2024-09-14 00:56:59]
  • Submitted

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 (max(r, k) >= n)
	{
		cout << max(r, k) * 2 << '\n';
	}
	else
	{
		int ans = r + n;
		if (ans & 1)
			ans++;
		cout << ans << '\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: 3696kb

input:

20 10 5

output:

30

result:

ok single line: '30'

Test #2:

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

input:

100 300 800

output:

1600

result:

ok single line: '1600'

Test #3:

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

input:

100 800 301

output:

1600

result:

ok single line: '1600'

Test #4:

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

input:

100 801 300

output:

1602

result:

ok single line: '1602'

Test #5:

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

input:

100 801 301

output:

1602

result:

ok single line: '1602'

Test #6:

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

input:

101 800 300

output:

1600

result:

ok single line: '1600'

Test #7:

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

input:

101 800 301

output:

1600

result:

ok single line: '1600'

Test #8:

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

input:

101 801 300

output:

1602

result:

ok single line: '1602'

Test #9:

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

input:

101 801 301

output:

1602

result:

ok single line: '1602'

Test #10:

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

input:

300 100 800

output:

1600

result:

ok single line: '1600'

Test #11:

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

input:

300 100 801

output:

1602

result:

ok single line: '1602'

Test #12:

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

input:

300 101 800

output:

1600

result:

ok single line: '1600'

Test #13:

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

input:

100 300 801

output:

1602

result:

ok single line: '1602'

Test #14:

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

input:

300 101 801

output:

1602

result:

ok single line: '1602'

Test #15:

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

input:

301 100 800

output:

1600

result:

ok single line: '1600'

Test #16:

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

input:

301 100 801

output:

1602

result:

ok single line: '1602'

Test #17:

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

input:

301 101 800

output:

1600

result:

ok single line: '1600'

Test #18:

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

input:

301 101 801

output:

1602

result:

ok single line: '1602'

Test #19:

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

input:

300 800 100

output:

1600

result:

ok single line: '1600'

Test #20:

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

input:

300 800 101

output:

1600

result:

ok single line: '1600'

Test #21:

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

input:

300 801 100

output:

1602

result:

ok single line: '1602'

Test #22:

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

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: 3548kb

input:

100 301 800

output:

1600

result:

ok single line: '1600'

Test #25:

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

input:

301 800 101

output:

1600

result:

ok single line: '1600'

Test #26:

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

input:

301 801 100

output:

1602

result:

ok single line: '1602'

Test #27:

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

input:

301 801 101

output:

1602

result:

ok single line: '1602'

Test #28:

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

input:

800 100 300

output:

900

result:

ok single line: '900'

Test #29:

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

input:

800 100 301

output:

900

result:

ok single line: '900'

Test #30:

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

input:

800 101 300

output:

902

result:

ok single line: '902'

Test #31:

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

input:

800 101 301

output:

902

result:

ok single line: '902'

Test #32:

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

input:

801 100 300

output:

902

result:

ok single line: '902'

Test #33:

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

input:

801 100 301

output:

902

result:

ok single line: '902'

Test #34:

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

input:

801 101 300

output:

902

result:

ok single line: '902'

Test #35:

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

input:

100 301 801

output:

1602

result:

ok single line: '1602'

Test #36:

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

input:

801 101 301

output:

902

result:

ok single line: '902'

Test #37:

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

input:

800 300 100

output:

1100

result:

ok single line: '1100'

Test #38:

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

input:

800 300 101

output:

1100

result:

ok single line: '1100'

Test #39:

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

input:

800 301 100

output:

1102

result:

ok single line: '1102'

Test #40:

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

input:

800 301 101

output:

1102

result:

ok single line: '1102'

Test #41:

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

input:

801 300 100

output:

1102

result:

ok single line: '1102'

Test #42:

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

input:

801 300 101

output:

1102

result:

ok single line: '1102'

Test #43:

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

input:

801 301 100

output:

1102

result:

ok single line: '1102'

Test #44:

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

input:

801 301 101

output:

1102

result:

ok single line: '1102'

Test #45:

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

input:

101 300 800

output:

1600

result:

ok single line: '1600'

Test #46:

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

input:

101 300 801

output:

1602

result:

ok single line: '1602'

Test #47:

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

input:

101 301 800

output:

1600

result:

ok single line: '1600'

Test #48:

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

input:

101 301 801

output:

1602

result:

ok single line: '1602'

Test #49:

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

input:

100 800 300

output:

1600

result:

ok single line: '1600'