結果
問題 | No.920 あかあお |
ユーザー |
|
提出日時 | 2023-08-13 10:57:50 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 424 bytes |
コンパイル時間 | 1,433 ms |
コンパイル使用メモリ | 168,740 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-21 05:20:40 |
合計ジャッジ時間 | 2,165 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 11 |
ソースコード
#include <bits/stdc++.h> using namespace std; using ll = long long; using llu = long long unsigned; vector<ll> dx = { 0, 0, -1, 1}; vector<ll> dy = {-1, 1, 0, 0}; #define MOD 1000000007 int main() { int X, Y, Z; cin >> X >> Y >> Z; int result = 0; if (abs(X-Y) > Z) { result = min(X, Y) + Z; } else { result = max(X, Y) + (Z-abs(X-Y))/2; } cout << result << endl; return 0; }