結果
| 問題 | No.3640 Babies don't like Bat Beat |
| コンテスト | |
| ユーザー |
shobonvip
|
| 提出日時 | 2026-08-25 14:40:48 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 633 bytes |
| 記録 | |
| コンパイル時間 | 272 ms |
| コンパイル使用メモリ | 95,984 KB |
| 実行使用メモリ | 243,356 KB |
| 最終ジャッジ日時 | 2026-08-25 14:41:05 |
| 合計ジャッジ時間 | 14,914 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| サブタスク | 配点 | 結果 |
|---|---|---|
| サンプル | 0 % | |
| 小課題1 | 10 % | AC * 5 |
| 小課題2 | 10 % | AC * 10 |
| 小課題3 | 15 % | AC * 4 WA * 1 |
| 小課題4 | 20 % | AC * 9 WA * 1 |
| 小課題5 | 20 % | AC * 14 WA * 1 |
| 小課題6 | 25 % | AC * 24 WA * 1 TLE * 1 -- * 7 |
| 合計 | 20 点 |
ソースコード
from fractions import Fraction from collections import defaultdict n = int(input()) d = defaultdict(int) now = 0 for i in range(n): l, r = map(int,input().split()) g = 1 while g < l: g *= 2 #print(g,l,r) assert l <= g assert 2*l > g if r >= g and r <= 2*g: now += 1 d[Fraction(r, g)] -= 1 if 2*l >= g and 2*l <= 2*g: d[Fraction(2*l, g)] += 1 if 2*r >= g and 2*r <= 2*g: d[Fraction(2*r, g)] -= 1 if 4*l >= g and 4*l <= 2*g: d[Fraction(4*l, g)] += 1 if 4*r >= g and 4*r <= 2*g: d[Fraction(4*r, g)] -= 1 ans = now for i, c in sorted(d.items()): now += c #print(i,c,now) ans = max(ans, now) print(ans)
shobonvip