結果

問題 No.610 区間賞(Section Award)
ユーザー mkawa2mkawa2
提出日時 2020-05-30 17:10:18
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 177 ms / 2,000 ms
コード長 1,051 bytes
コンパイル時間 230 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 24,892 KB
最終ジャッジ日時 2024-04-25 09:52:04
合計ジャッジ時間 6,477 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
10,752 KB
testcase_01 AC 31 ms
10,752 KB
testcase_02 AC 34 ms
10,752 KB
testcase_03 AC 31 ms
10,880 KB
testcase_04 AC 32 ms
10,752 KB
testcase_05 AC 31 ms
10,880 KB
testcase_06 AC 34 ms
10,752 KB
testcase_07 AC 32 ms
10,752 KB
testcase_08 AC 34 ms
10,752 KB
testcase_09 AC 32 ms
10,752 KB
testcase_10 AC 32 ms
10,752 KB
testcase_11 AC 32 ms
10,752 KB
testcase_12 AC 32 ms
10,752 KB
testcase_13 AC 33 ms
10,880 KB
testcase_14 AC 34 ms
10,752 KB
testcase_15 AC 33 ms
10,752 KB
testcase_16 AC 32 ms
10,752 KB
testcase_17 AC 32 ms
10,752 KB
testcase_18 AC 33 ms
10,752 KB
testcase_19 AC 48 ms
13,696 KB
testcase_20 AC 111 ms
24,892 KB
testcase_21 AC 41 ms
12,544 KB
testcase_22 AC 80 ms
19,604 KB
testcase_23 AC 39 ms
12,032 KB
testcase_24 AC 50 ms
14,272 KB
testcase_25 AC 36 ms
11,648 KB
testcase_26 AC 65 ms
16,952 KB
testcase_27 AC 106 ms
24,580 KB
testcase_28 AC 98 ms
22,508 KB
testcase_29 AC 81 ms
19,112 KB
testcase_30 AC 93 ms
21,556 KB
testcase_31 AC 63 ms
16,180 KB
testcase_32 AC 101 ms
22,992 KB
testcase_33 AC 41 ms
12,672 KB
testcase_34 AC 107 ms
23,980 KB
testcase_35 AC 67 ms
17,308 KB
testcase_36 AC 108 ms
23,396 KB
testcase_37 AC 93 ms
22,032 KB
testcase_38 AC 49 ms
13,824 KB
testcase_39 AC 109 ms
24,360 KB
testcase_40 AC 110 ms
24,356 KB
testcase_41 AC 112 ms
24,364 KB
testcase_42 AC 109 ms
24,440 KB
testcase_43 AC 110 ms
24,492 KB
testcase_44 AC 147 ms
21,848 KB
testcase_45 AC 173 ms
24,100 KB
testcase_46 AC 177 ms
24,232 KB
testcase_47 AC 94 ms
21,944 KB
testcase_48 AC 89 ms
21,836 KB
testcase_49 AC 96 ms
22,204 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from operator import itemgetter
from itertools import *
from bisect import *
from collections import *
from heapq import *
import sys

sys.setrecursionlimit(10 ** 6)

def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def SI(): return sys.stdin.readline()[:-1]
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def LLI1(rows_number): return [LI1() for _ in range(rows_number)]
int1 = lambda x: int(x) - 1
def MI1(): return map(int1, sys.stdin.readline().split())
def LI1(): return list(map(int1, sys.stdin.readline().split()))
p2D = lambda x: print(*x, sep="\n")
dij = [(1, 0), (0, 1), (-1, 0), (0, -1)]

def main():
    n=II()
    aa=LI()
    bb=LI()

    ng=[False]*(n+1)
    bi=0
    for a in aa:
        if a==bb[bi]:
            bi+=1
            while bi<n and ng[bb[bi]]:bi+=1
            if bi==n:break
        else:
            ng[a]=True

    for a in range(1,n+1):
        if ng[a]:continue
        print(a)

main()
0