結果
問題 | No.920 あかあお |
ユーザー | RTnF |
提出日時 | 2019-11-08 21:22:55 |
言語 | C++17 (gcc 13.2.0 + boost 1.83.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 1,670 bytes |
コンパイル時間 | 2,029 ms |
コンパイル使用メモリ | 201,720 KB |
実行使用メモリ | 4,348 KB |
最終ジャッジ日時 | 2023-10-24 11:10:09 |
合計ジャッジ時間 | 2,777 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge15 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
4,348 KB |
testcase_01 | AC | 2 ms
4,348 KB |
testcase_02 | AC | 2 ms
4,348 KB |
testcase_03 | AC | 1 ms
4,348 KB |
testcase_04 | AC | 2 ms
4,348 KB |
testcase_05 | AC | 1 ms
4,348 KB |
testcase_06 | AC | 2 ms
4,348 KB |
testcase_07 | AC | 2 ms
4,348 KB |
testcase_08 | AC | 2 ms
4,348 KB |
testcase_09 | AC | 2 ms
4,348 KB |
testcase_10 | AC | 1 ms
4,348 KB |
testcase_11 | AC | 2 ms
4,348 KB |
testcase_12 | AC | 2 ms
4,348 KB |
testcase_13 | AC | 2 ms
4,348 KB |
ソースコード
#include <bits/stdc++.h> using namespace std; using ll = long long; using ull = unsigned long long; using ld = long double; using vi = vector<int>; using vvi = vector<vi>; using vvvi = vector<vvi>; using vll = vector<ll>; using vvll = vector<vll>; using vvvll = vector<vvll>; using vs = vector<string>; using pll = pair<ll, ll>; using vp = vector<pll>; #define rep(i, n) for(ll i = 0; i < (n); i++) #define repb(i, n) for(ll i = (n)-1; i >= 0; i--) #define repr(i, a, b) for(ll i = (a); i < (b); i++) #define reprb(i, a, b) for(ll i = (b)-1; i >= (a); i--) #define ALL(a) (a).begin(), (a).end() #define SZ(x) ((ll)(x).size()) const ll MOD = 1000000007; const ll INF = 100000000000000000LL; const ld EPS = 1e-12L; const ld PI = 3.1415926535897932385L; inline ll GCD(ll a, ll b){ return b?GCD(b, a % b):a; } inline ll LCM(ll a, ll b){ return a/GCD(a, b)*b; } inline ll powint(ull x, ll y){ ll r=1; while(y){ if(y&1) r*=x; x*=x; y>>=1; } return r; } inline ll powmod(ll x, ll y, ll m = MOD){ ll r=1; while(y){ if(y&1) r*=x; x*=x; r%=m; x%=m; y>>=1; } return r; } template<class S, class T>inline bool chmax(S &a, const T &b){ if(a<b) { a=b; return 1; } return 0; } template<class S, class T>inline bool chmin(S &a, const T &b){ if(b<a) { a=b; return 1; } return 0; } #ifdef OJ_LOCAL #include "dump.hpp" #else #define dump(...) ((void)0) #endif int main(){ cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(15); ll x, y, z; cin >> x >> y >> z; if(x > y) swap(x, y); ll a1 = min(y-x, z); x += a1; z -= a1; if(z > 0){ cout << x + z/2 << endl; }else{ cout << min(x, y) << endl; } return 0; }