結果

問題 No.1860 Magnets
ユーザー ma_twma_tw
提出日時 2022-03-04 21:30:35
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 2,152 bytes
コンパイル時間 2,023 ms
コンパイル使用メモリ 200,164 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-26 00:06:33
合計ジャッジ時間 3,172 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 2 ms
4,376 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 2 ms
4,376 KB
testcase_11 AC 2 ms
4,376 KB
testcase_12 AC 2 ms
4,376 KB
testcase_13 AC 2 ms
4,380 KB
testcase_14 AC 1 ms
4,380 KB
testcase_15 AC 1 ms
4,376 KB
testcase_16 AC 2 ms
4,380 KB
testcase_17 AC 1 ms
4,376 KB
testcase_18 AC 1 ms
4,376 KB
testcase_19 AC 1 ms
4,380 KB
testcase_20 AC 1 ms
4,376 KB
testcase_21 AC 1 ms
4,380 KB
testcase_22 AC 1 ms
4,380 KB
testcase_23 AC 1 ms
4,376 KB
testcase_24 AC 1 ms
4,380 KB
testcase_25 AC 1 ms
4,376 KB
testcase_26 AC 1 ms
4,380 KB
testcase_27 AC 2 ms
4,376 KB
testcase_28 AC 1 ms
4,376 KB
testcase_29 AC 1 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#pragma region Template
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vll = vector<ll>;
using vvi = vector<vector<int>>;
using vvll = vector<vector<ll>>;
using vpi = vector<pair<int,int>>;
using vpll = vector<pair<ll,ll>>;
using vs = vector<string>;
using pi = pair<int,int>;
using pll = pair<ll,ll>;
#define fi first
#define se second
#define pb push_back
#define fore(p,a) for (auto p : a)
#define overload4(a,b,c,d,name,...) name
#define rep1(n) for (ll i = 0; i < ll(n); ++i)
#define rep2(i,n) for (ll i = 0; i < ll(n); ++i)
#define rep3(i,a,b) for (ll i = a; i < ll(b); ++i)
#define rep4(i,a,b,c) for (ll i = a; i < ll(b); i += c)
#define rep(...) overload4(__VA_ARGS__,rep4,rep3,rep2,rep1)(__VA_ARGS__)
#define rrep1(n) for (ll i = n; i--;)
#define rrep2(i,n) for (ll i = n; i--;)
#define rrep3(i,a,b) for (ll i = b; i-- > (a);)
#define rrep4(i,a,b,c) for (ll i = (a) + ((b) - (a) - 1) / (c) * (c); i >= (a); i-=c)
#define rrep(...) overload4(__VA_ARGS__,rrep4,rrep3,rrep2,rrep1)(__VA_ARGS__)
#define all(container) begin(container), end(container)
#define rall(container) rbegin(container), rend(container)
#define Vvll(name,row,column) vvll name(row, vll (column))
#define Max(...) max({__VA_ARGS__})
#define Min(...) min({__VA_ARGS__})
#define fin exit(0)
const int INF = 1e9 + 10;
const ll LINF = 1LL << 60;
const double PI = 3.141592653589793238462643383279;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
ll fact(ll x) { return x == 0 ? 1 : x * fact(x - 1); }
ll comb(ll n, ll r) { if (r == 0 || r == n) return 1; else if (r == 1) return n; return comb(n - 1, r - 1) + comb(n - 1, r); }
void prfl(double x) { printf("%.15f\n", x); }
bool ise(ll x) { return x % 2 == 0; }
bool dv(ll waru, ll warareru) { return warareru % waru == 0; }
int ci(char c) { return c - '0'; }
char ic(int i) { return '0' + i; }
#pragma endregion


int main() {
    ll a, b; cin >> a >> b;
    if (a != b) cout << 2 * max(a, b) - 1 << '\n';
    else cout << 2 * a << '\n';
}
0