結果

問題 No.1768 The frog in the well knows the great ocean.
ユーザー kutsutamakutsutama
提出日時 2021-11-30 12:38:38
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 519 bytes
コンパイル時間 340 ms
コンパイル使用メモリ 87,004 KB
実行使用メモリ 98,644 KB
最終ジャッジ日時 2023-09-16 05:21:07
合計ジャッジ時間 6,210 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,276 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 128 ms
95,692 KB
testcase_13 WA -
testcase_14 AC 125 ms
96,060 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 130 ms
98,148 KB
testcase_20 AC 130 ms
97,920 KB
testcase_21 AC 70 ms
71,300 KB
testcase_22 AC 70 ms
71,168 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 128 ms
98,644 KB
testcase_27 AC 70 ms
71,300 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

t = int(input())
for _ in range(t):
    n = int(input())
    a = [int(x) for x in input().split()]
    b = [int(x) for x in input().split()]

    ok = True
    l = 0
    r = 0
    while l < n:
        for i in range(l, n - 1):
            if b[i + 1] != b[i]:
                r = i
                break
            r = i + 1
        aMax = max(a[l:(r + 1)])
        if aMax != b[l]:
            ok = False
            break
        l = r + 1
        r = l
    if ok:
        print("Yes")
    else:
        print("No")
0