結果
問題 |
No.91 赤、緑、青の石
|
ユーザー |
|
提出日時 | 2017-01-01 02:35:52 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 396 bytes |
コンパイル時間 | 753 ms |
コンパイル使用メモリ | 68,596 KB |
実行使用メモリ | 17,096 KB |
最終ジャッジ日時 | 2024-12-16 04:52:34 |
合計ジャッジ時間 | 79,970 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 WA * 1 |
other | AC * 5 WA * 11 TLE * 12 |
ソースコード
#include <iostream> #include<algorithm> using namespace std; int main() { int a[3]; cin>>a[0]>>a[1]>>a[2]; sort(a,a+3); int s=0; while(1) { s+=a[0]; a[2]-=a[0];a[1]-=a[0]; if(a[1]+1<a[2]) { a[0]=(a[2]-a[1])/2; a[2]-=a[0]*2; } else { a[0]=a[1]/4; a[1]-=a[0]*2; a[2]-=a[0]*2; } sort(a,a+3); if(a[0]==0&&a[1]<3&&a[2]<3)break; } cout<<s<<endl; return 0; }