結果

問題 No.920 あかあお
ユーザー nn1k_
提出日時 2019-11-08 21:27:09
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 523 bytes
コンパイル時間 1,693 ms
コンパイル使用メモリ 167,328 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-09-16 05:53:49
合計ジャッジ時間 2,500 ms
ジャッジサーバーID
(参考情報)
judge2 / judge6
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 9 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

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

using int64 = long long;
using i64 = int64;

#define rep(i,N) for(int i=0;i<(int)(N); ++i)

const int inf = 1 << 30;
const int64 inf64 = 1ll << 60;

double dp[301][301][301];

int main() {
   int x, y, z; cin >> x >> y >> z;

   int ans = min(x, y);
   int n= min(x, y);
   x -= n;
   y -= n;

   if(x > y) swap(x, y);


   if(y <= z) {
      ans += y;
      z -= y;
   } else {
      cout << ans + x << endl;
      return 0;
   }

   ans += z / 2;

   cout << ans << endl;
}
0