結果

問題 No.647 明太子
ユーザー syunsukesyunsuke
提出日時 2018-06-22 22:46:09
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 3,980 ms / 4,500 ms
コード長 972 bytes
コンパイル時間 80 ms
コンパイル使用メモリ 10,720 KB
実行使用メモリ 10,188 KB
最終ジャッジ日時 2023-09-13 08:09:03
合計ジャッジ時間 13,378 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
8,168 KB
testcase_01 AC 16 ms
8,084 KB
testcase_02 AC 15 ms
8,172 KB
testcase_03 AC 15 ms
8,228 KB
testcase_04 AC 15 ms
8,180 KB
testcase_05 AC 15 ms
8,176 KB
testcase_06 AC 15 ms
8,172 KB
testcase_07 AC 16 ms
7,860 KB
testcase_08 AC 17 ms
8,228 KB
testcase_09 AC 49 ms
8,156 KB
testcase_10 AC 86 ms
8,284 KB
testcase_11 AC 30 ms
8,228 KB
testcase_12 AC 72 ms
8,220 KB
testcase_13 AC 147 ms
8,104 KB
testcase_14 AC 1,583 ms
9,572 KB
testcase_15 AC 212 ms
8,440 KB
testcase_16 AC 63 ms
8,248 KB
testcase_17 AC 1,756 ms
9,480 KB
testcase_18 AC 2,061 ms
9,428 KB
testcase_19 AC 669 ms
9,392 KB
testcase_20 AC 777 ms
9,264 KB
testcase_21 AC 294 ms
8,472 KB
testcase_22 AC 3,980 ms
10,188 KB
testcase_23 AC 18 ms
8,236 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
listm=[]
for i in range(N):
    line=input()
    line=line.rstrip().split(" ")
    a=[int(line[0]),int(line[1])]
    listm.append(a)
#print(listm)
    
M=int(input())
list1=[0]*M
#print(list1)
listmen=[]
for j in range(M):
    line=input()
    line=line.rstrip().split(" ")
    a=[int(line[0]),int(line[1])]
    listmen.append(a)
#print(listmen)

for k in range(M):
    
    for l in range(N):
        if listm[l][0]>=listmen[k][0] and listm[l][1]<=listmen[k][1]:
            list1[k]=list1[k]+1
        else:
            l+=1
#print(list1)
if sum(list1)==0:
    print(0)
else:
    list2=[]
    for m in range(M):
        a=[list1[m],m+1]
        list2.append(a)
    list2.sort(reverse=True)
    list3=[[list2[0][0],list2[0][1]]]
    for n in range(1,M):
        if list2[0][0]==list2[n][0]:
            list3.append([list2[n][0],list2[n][1]])
        else:
            break
    list3.sort()
    for o in range(len(list3)):
        print(list3[o][1])
    
0