結果

問題 No.920 あかあお
ユーザー okake_1109
提出日時 2020-02-26 18:55:29
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 307 bytes
コンパイル時間 1,330 ms
コンパイル使用メモリ 166,668 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-10-13 15:27:25
合計ジャッジ時間 2,013 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main() {
  int x,y,z,ans =0;
  cin >> x >> y >> z;
  int d = max(x,y)-min(x,y);
  ans += min(x,y);
  if(d < z){
    ans += d;
    ans += (z-d)/2;
    cout << ans << endl;
    return 0;
  }
  else{
    ans += z;
    cout << ans << endl;
    return 0;
  }
}
0