結果
| 問題 |
No.91 赤、緑、青の石
|
| ユーザー |
|
| 提出日時 | 2017-01-01 02:33:06 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 369 bytes |
| コンパイル時間 | 581 ms |
| コンパイル使用メモリ | 68,608 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-12-16 04:50:39 |
| 合計ジャッジ時間 | 1,787 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 WA * 3 |
| other | AC * 10 WA * 18 |
ソースコード
#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]=1;
a[2]-=2;
}
sort(a,a+3);
if(a[0]==0&&a[1]<3&&a[2]<3)break;
}
cout<<s<<endl;
return 0;
}