結果

問題 No.647 明太子
ユーザー kichirb3kichirb3
提出日時 2018-03-02 08:56:50
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,155 ms / 4,500 ms
コード長 841 bytes
コンパイル時間 202 ms
コンパイル使用メモリ 10,984 KB
実行使用メモリ 10,004 KB
最終ジャッジ日時 2023-09-09 09:38:31
合計ジャッジ時間 4,750 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,816 KB
testcase_01 AC 15 ms
7,824 KB
testcase_02 AC 14 ms
7,816 KB
testcase_03 AC 15 ms
7,872 KB
testcase_04 AC 15 ms
7,936 KB
testcase_05 AC 15 ms
7,912 KB
testcase_06 AC 14 ms
7,900 KB
testcase_07 AC 15 ms
7,816 KB
testcase_08 AC 16 ms
7,824 KB
testcase_09 AC 24 ms
8,380 KB
testcase_10 AC 34 ms
8,352 KB
testcase_11 AC 19 ms
7,836 KB
testcase_12 AC 29 ms
8,268 KB
testcase_13 AC 51 ms
8,252 KB
testcase_14 AC 431 ms
9,644 KB
testcase_15 AC 70 ms
8,544 KB
testcase_16 AC 29 ms
8,200 KB
testcase_17 AC 535 ms
9,696 KB
testcase_18 AC 571 ms
9,648 KB
testcase_19 AC 178 ms
9,556 KB
testcase_20 AC 194 ms
9,400 KB
testcase_21 AC 78 ms
8,752 KB
testcase_22 AC 1,155 ms
10,004 KB
testcase_23 AC 16 ms
7,820 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# -*- coding: utf-8 -*-
"""
No.647 明太子
https://yukicoder.me/problems/no/647

"""
import sys
from sys import stdin

input = stdin.readline


def main(args):
    N = int(input())
    criteria = []
    for _ in range(N):
        A, B = map(int, input().split())
        criteria.append([A, B])

    M = int(input())
    mentaiko = []
    for _ in range( M):
        X, Y = map(int, input().split())
        mentaiko.append([X, Y])

    votes = [0] * M
    for A, B in criteria:
        for i, m in zip(range(M), mentaiko):
            X, Y = m[0], m[1]
            if (X <= A and Y >= B):
                votes[i] += 1

    max_vote = max(votes)
    if max_vote == 0:
        print(0)
    else:
        for i in range(M):
            if votes[i] == max_vote:
                print(i+1)


if __name__ == '__main__':
    main(sys.argv[1:])
0