結果
問題 | No.91 赤、緑、青の石 |
ユーザー |
![]() |
提出日時 | 2015-07-23 01:49:03 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 35 ms / 5,000 ms |
コード長 | 296 bytes |
コンパイル時間 | 1,357 ms |
コンパイル使用メモリ | 160,480 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-24 06:50:49 |
合計ジャッジ時間 | 2,737 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 28 |
ソースコード
#include <bits/stdc++.h>using namespace std;int main() {array<int, 3> a;for (int& i : a) cin >> i;int res = 0;while (a[2] >= 0) {sort(a.begin(), a.end());int r = a[0];for (int& i : a) i -= r;res += r;a[0] += 1;a[2] -= 2;}cout << res << endl;}