結果

問題 No.920 あかあお
ユーザー soragsorag
提出日時 2022-08-06 00:24:24
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 592 bytes
コンパイル時間 1,446 ms
コンパイル使用メモリ 73,996 KB
実行使用メモリ 4,356 KB
最終ジャッジ日時 2023-10-14 02:43:24
合計ジャッジ時間 2,062 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<map>
#define all(x) x.begin(),x.end()
#define pb push_back
#define ll long long 
#define P pair<int,int>
#define LP pair<ll,ll>
using namespace std;
int main() {
	int a, b, c;
	int ans=0;
	cin >> a>>b>>c;
	if (a > b) {
		ans += b;
		for (int i = 1; i <= c; i++) {
			ans += 1;
			c -= 1;
			if (ans == a) break;
		}
	}
	else if (b > a) {
		ans += a;
		for (int i = 1; i <= c; i++) {
			ans += 1;
			c -= 1;
			if (ans == b) break;
		}
	}
	else 	ans += a;

	ans += c / 2;
	cout << ans << endl;
	return 0;
}



0