結果
問題 |
No.91 赤、緑、青の石
|
ユーザー |
|
提出日時 | 2025-03-07 15:16:20 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 753 bytes |
コンパイル時間 | 668 ms |
コンパイル使用メモリ | 82,880 KB |
実行使用メモリ | 53,892 KB |
最終ジャッジ日時 | 2025-03-07 15:16:23 |
合計ジャッジ時間 | 3,227 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 2 |
other | AC * 22 WA * 6 |
ソースコード
R,G,B = map(int,input().split()) left = -1 right = 10**9 + 1 ans = 0 def search(mid,R,G,B): count = 0 count += min(R,G,B) R -= count G -= count B -= count s = 0 if(R != 0 and R % 2 == 0): s += 1 if(G != 0 and G % 2 == 0): s += 1 if(B != 0 and B % 2 == 0): s += 1 t = R + G + B if(s != 2 and s != 0): count += t // 4 else: if((t //4 ) % 2 != s % 2): count += (t // 4) count -= 1 else: count += t // 4 return count while abs(left - right) > 1: mid = (left + right) // 2 if(search(mid,R,G,B) >= mid): left = mid ans = max(ans,mid) else: right = mid print(ans)