結果
問題 |
No.91 赤、緑、青の石
|
ユーザー |
![]() |
提出日時 | 2022-11-03 21:52:08 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 636 bytes |
コンパイル時間 | 1,502 ms |
コンパイル使用メモリ | 165,880 KB |
実行使用メモリ | 10,140 KB |
最終ジャッジ日時 | 2024-07-18 04:30:57 |
合計ジャッジ時間 | 13,784 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 4 |
other | TLE * 1 -- * 27 |
ソースコード
#include <bits/stdc++.h> using namespace std; bool can_create(int k,int r,int g,int b){ r -= k; g -= k; b -= k; int plus = 0; int minus = 0; if(r > 0){ plus += r; } else { minus += r; } if(g > 0){ plus += g; } else { minus += g; } if(b > 0){ plus += b; } else { minus += b; } if(plus >= minus * 2){ return true; } return false; } int main(){ int i,r,g,b; scanf("%d %d %d",&r,&g,&b); while(1){ if(!can_create(i,r,g,b)){ break; } i++; } printf("%d",i-1); }