結果

問題 No.647 明太子
ユーザー GrayCoder
提出日時 2018-02-09 23:40:19
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 626 bytes
コンパイル時間 418 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 12,288 KB
最終ジャッジ日時 2024-12-26 07:58:15
合計ジャッジ時間 4,867 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 5 WA * 15
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    N = int(input())
    AB = tuple(tuple(map(int, input().split())) for _ in [0] * N)
    M = int(input())
    XY = tuple(tuple(map(int, input().split())) for _ in [0] * M)

    men = {i:0 for i in range(M + 1)}
    ab = sorted(AB, reverse=True)
    xy = sorted(XY)
    for i, (x, y) in enumerate(xy):
        for a, b in ab:
            if a >= x:
                if b <= y:
                    men[i+1] += 1
            else:
                break

    maxv = max(men.values())
    if maxv == 0:
        print(0)
    else:
        for i in [key for key in men if men[key] == maxv]:
            print(i)

main()
0