結果

問題 No.2254 Reverse Only
ユーザー syndro_6syndro_6
提出日時 2023-03-24 21:50:48
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,098 bytes
コンパイル時間 153 ms
コンパイル使用メモリ 81,736 KB
実行使用メモリ 131,000 KB
最終ジャッジ日時 2023-10-18 20:59:05
合計ジャッジ時間 14,123 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 164 ms
90,156 KB
testcase_01 AC 165 ms
90,160 KB
testcase_02 AC 167 ms
90,164 KB
testcase_03 AC 169 ms
90,164 KB
testcase_04 AC 169 ms
90,152 KB
testcase_05 AC 171 ms
90,152 KB
testcase_06 AC 171 ms
90,148 KB
testcase_07 AC 169 ms
90,152 KB
testcase_08 WA -
testcase_09 AC 324 ms
130,560 KB
testcase_10 AC 251 ms
127,432 KB
testcase_11 AC 321 ms
130,400 KB
testcase_12 AC 317 ms
130,764 KB
testcase_13 AC 326 ms
130,368 KB
testcase_14 AC 321 ms
130,960 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 320 ms
130,964 KB
testcase_19 WA -
testcase_20 AC 304 ms
130,860 KB
testcase_21 AC 297 ms
130,912 KB
testcase_22 AC 232 ms
126,804 KB
testcase_23 AC 248 ms
127,668 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 167 ms
90,488 KB
testcase_28 AC 191 ms
100,548 KB
testcase_29 AC 232 ms
119,944 KB
testcase_30 WA -
testcase_31 AC 199 ms
102,252 KB
testcase_32 AC 201 ms
104,472 KB
testcase_33 AC 174 ms
93,524 KB
testcase_34 AC 256 ms
117,832 KB
testcase_35 AC 222 ms
113,872 KB
testcase_36 AC 293 ms
124,256 KB
testcase_37 AC 298 ms
125,332 KB
testcase_38 AC 185 ms
98,532 KB
testcase_39 WA -
testcase_40 AC 167 ms
90,488 KB
testcase_41 AC 212 ms
109,856 KB
testcase_42 AC 187 ms
98,716 KB
testcase_43 AC 256 ms
116,248 KB
testcase_44 AC 308 ms
129,720 KB
testcase_45 WA -
testcase_46 AC 164 ms
90,488 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from collections import defaultdict, deque
from math import gcd, inf, factorial
from bisect import bisect_left, bisect_right, insort_left, insort_right
from heapq import heapify, heappop, heappush
from decimal import Decimal
from copy import deepcopy
from pprint import pprint

MOD = 998244353

input = lambda : sys.stdin.readline().rstrip()
LIP = lambda : list(map(int, input().split()))
LSP = lambda : list(input().split())
TIP = lambda : tuple(map(int, input().split()))
TSP = lambda : tuple(input().split())
SIP = lambda : set(map(int, input().split()))
SSP = lambda : set(input().split())
yes = lambda : print("Yes")
no = lambda : print("No")
dame = lambda : print(-1)
mint = lambda n: (n + MOD) % MOD

#----------------------------------------------

def main():
    N, K = LIP()
    A = LIP()
    B = LIP()
    sortedA = sorted(A)
    sortedB = sorted(B)
    if sortedA != sortedB:
        return no()
    l = max(0, N - K + 1)
    r = min(N, K - 1)
    for i in range(l, r):
        if A[i] != B[i]:
            return no()
    return yes()

if __name__ == '__main__':
    main()
0