結果
問題 | No.91 赤、緑、青の石 |
ユーザー |
|
提出日時 | 2018-01-07 21:59:16 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 42 ms / 5,000 ms |
コード長 | 342 bytes |
コンパイル時間 | 552 ms |
コンパイル使用メモリ | 63,260 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-24 07:13:11 |
合計ジャッジ時間 | 1,851 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 28 |
ソースコード
#include <iostream> #include <math.h> #include <algorithm> using namespace std; int main() { int a[3]; for (int i = 0; i < 3; i++) { cin >> a[i]; } sort(a, a + 3); while (a[0] + 2 <= a[2]) { a[0] += 1; a[2] -= 2; sort(a, a + 3); } cout << min({ a[0],a[1],a[2] }) << endl; return 0; }