結果

問題 No.91 赤、緑、青の石
ユーザー sayusayu
提出日時 2014-12-09 22:12:48
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 700 bytes
コンパイル時間 2,262 ms
コンパイル使用メモリ 73,820 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-02 12:14:17
合計ジャッジ時間 2,495 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
4,376 KB
testcase_01 AC 12 ms
4,376 KB
testcase_02 AC 8 ms
4,376 KB
testcase_03 AC 13 ms
4,376 KB
testcase_04 AC 7 ms
4,376 KB
testcase_05 AC 15 ms
4,380 KB
testcase_06 WA -
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 6 ms
4,380 KB
testcase_12 AC 14 ms
4,380 KB
testcase_13 AC 14 ms
4,376 KB
testcase_14 AC 10 ms
4,380 KB
testcase_15 AC 17 ms
4,376 KB
testcase_16 AC 2 ms
4,380 KB
testcase_17 AC 2 ms
4,380 KB
testcase_18 AC 1 ms
4,376 KB
testcase_19 AC 2 ms
4,376 KB
testcase_20 AC 2 ms
4,376 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 2 ms
4,376 KB
testcase_24 AC 2 ms
4,376 KB
testcase_25 AC 21 ms
4,380 KB
testcase_26 AC 23 ms
4,380 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 17 ms
4,376 KB
testcase_31 AC 22 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <algorithm>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
typedef pair<int, int> pii;
typedef vector<int> vi;
#define rep(i,x) for(int i=0;i<(int)(x);++i)

int main(){
	int ans, min, a[3], *mn, *mx;
	rep(i,3) cin >> a[i];
	ans = *min_element(a, a+3);
	rep(i,3) a[i] -= ans;
	while (1) {
		mx = max_element(a, a+3);
		mn = min_element(a, a+3);
		++a[mn-a];
		a[mx-a] -= 2;
		mn = min_element(a, a+3);
		if (*mn < 1) break;
		++ans;
		rep(i,3) --a[i];
	}
	cout << ans << endl;
	return 0;
}
0