結果

問題 No.920 あかあお
ユーザー nn1k_nn1k_
提出日時 2019-11-08 21:27:09
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 523 bytes
コンパイル時間 1,632 ms
コンパイル使用メモリ 164,484 KB
実行使用メモリ 4,352 KB
最終ジャッジ日時 2023-10-14 11:01:40
合計ジャッジ時間 2,595 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 1 ms
4,352 KB
testcase_02 AC 1 ms
4,352 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 AC 1 ms
4,352 KB
testcase_05 AC 1 ms
4,352 KB
testcase_06 AC 2 ms
4,348 KB
testcase_07 AC 1 ms
4,352 KB
testcase_08 AC 1 ms
4,352 KB
testcase_09 AC 1 ms
4,352 KB
testcase_10 AC 1 ms
4,348 KB
testcase_11 AC 1 ms
4,352 KB
testcase_12 WA -
testcase_13 WA -
権限があれば一括ダウンロードができます

ソースコード

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