結果

問題 No.2254 Reverse Only
ユーザー syndro_6syndro_6
提出日時 2023-03-24 21:47:12
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,094 bytes
コンパイル時間 623 ms
コンパイル使用メモリ 81,716 KB
実行使用メモリ 130,968 KB
最終ジャッジ日時 2023-10-18 20:57:28
合計ジャッジ時間 14,057 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 165 ms
90,216 KB
testcase_01 AC 164 ms
90,208 KB
testcase_02 AC 164 ms
90,200 KB
testcase_03 AC 164 ms
90,204 KB
testcase_04 AC 167 ms
90,208 KB
testcase_05 AC 165 ms
90,188 KB
testcase_06 AC 168 ms
90,204 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 317 ms
130,520 KB
testcase_10 AC 244 ms
127,384 KB
testcase_11 AC 315 ms
130,372 KB
testcase_12 AC 312 ms
130,732 KB
testcase_13 AC 316 ms
130,344 KB
testcase_14 AC 316 ms
130,932 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 317 ms
130,936 KB
testcase_19 WA -
testcase_20 AC 297 ms
130,828 KB
testcase_21 AC 297 ms
130,888 KB
testcase_22 AC 232 ms
126,768 KB
testcase_23 AC 245 ms
127,648 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 170 ms
90,460 KB
testcase_28 AC 194 ms
100,508 KB
testcase_29 AC 237 ms
119,900 KB
testcase_30 WA -
testcase_31 AC 197 ms
102,220 KB
testcase_32 AC 203 ms
104,440 KB
testcase_33 AC 178 ms
93,488 KB
testcase_34 AC 255 ms
117,768 KB
testcase_35 AC 227 ms
113,832 KB
testcase_36 AC 294 ms
124,228 KB
testcase_37 AC 301 ms
125,300 KB
testcase_38 AC 188 ms
98,504 KB
testcase_39 WA -
testcase_40 AC 169 ms
90,456 KB
testcase_41 AC 217 ms
109,788 KB
testcase_42 AC 192 ms
98,688 KB
testcase_43 AC 260 ms
116,212 KB
testcase_44 AC 311 ms
129,692 KB
testcase_45 WA -
testcase_46 AC 169 ms
90,468 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 + 2)
    r = min(N, K)
    for i in range(l, r):
        if A[i] != B[i]:
            return no()
    return yes()

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