結果
| 問題 |
No.3241 Make Multiplication of 8
|
| コンテスト | |
| ユーザー |
detteiuu
|
| 提出日時 | 2025-08-22 21:05:29 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 200 ms / 2,000 ms |
| コード長 | 345 bytes |
| コンパイル時間 | 336 ms |
| コンパイル使用メモリ | 82,252 KB |
| 実行使用メモリ | 85,112 KB |
| 最終ジャッジ日時 | 2025-08-22 21:05:34 |
| 合計ジャッジ時間 | 4,636 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 23 |
ソースコード
N = int(input())
AB = [list(map(int, input().split())) for _ in range(N)]
C = [0]*3
for A, B in AB:
cnt = 0
while cnt < 3 and A%2 == 0:
A //= 2
cnt += 1
if cnt:
C[cnt-1] += B
ans = C[2]
MIN = min(C[:2])
ans += MIN
C[0] -= MIN
C[1] -= MIN
if C[0]:
ans += C[0]//3
elif C[1]:
ans += C[1]//2
print(ans)
detteiuu