結果
問題 |
No.920 あかあお
|
ユーザー |
![]() |
提出日時 | 2020-11-23 19:49:46 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 420 bytes |
コンパイル時間 | 1,983 ms |
コンパイル使用メモリ | 192,708 KB |
最終ジャッジ日時 | 2025-01-16 05:08:38 |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 11 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main(){ int r,b,w; cin>>r>>b>>w; if(r==b){ cout<<r+w/2<<endl; return 0; } if(r>b && r-b>=w){ cout<<b+w<<endl; return 0; } if(r>b && r-b<w){ cout<<r+(w-r+b)/2<<endl; return 0; } if(r<b && b-r>=w){ cout<<r+w<<endl; return 0; } if(r<b && b-r<w){ cout<<b+(w-b+r)/2<<endl; return 0; } return 0; }