結果
問題 | No.91 赤、緑、青の石 |
ユーザー |
![]() |
提出日時 | 2019-10-28 18:15:05 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 41 ms / 5,000 ms |
コード長 | 672 bytes |
コンパイル時間 | 194 ms |
コンパイル使用メモリ | 82,432 KB |
実行使用メモリ | 53,932 KB |
最終ジャッジ日時 | 2024-06-24 07:21:26 |
合計ジャッジ時間 | 2,299 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 28 |
ソースコード
import sysinput = sys.stdin.readlinedef main():def isOK(m):r = R - mg = G - mb = B - mcnt = 0for s in [r, g, b]:if s>=0:cnt += s//2for s in [r, g, b]:if s<0:cnt += sreturn cnt >= 0def binary_search(ok, ng):while abs(ok - ng) > 1:mid = (ok + ng) // 2if isOK(mid):ok = midelse:ng = midreturn okR, G, B = map(int, input().split())ok = -1ng = 10000010print(binary_search(ok, ng))if __name__ == '__main__':main()