結果
問題 |
No.1768 The frog in the well knows the great ocean.
|
ユーザー |
👑 ![]() |
提出日時 | 2021-11-26 23:46:36 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 556 bytes |
コンパイル時間 | 148 ms |
コンパイル使用メモリ | 81,876 KB |
実行使用メモリ | 116,052 KB |
最終ジャッジ日時 | 2024-06-29 19:08:16 |
合計ジャッジ時間 | 4,151 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 8 WA * 19 |
ソースコード
def solve(N,A,B): for i in range(N): if A[i]>B[i]: return False X=[[0,0]] for i in range(1,N): if B[i-1]==B[i]: X[-1][1]+=1 else: X.append([i,i]) for x,y in X: alpha=0 for k in range(x,y+1): alpha=max(alpha,A[k]) if alpha!=B[x]: return False return True T=int(input()) for _ in range(T): N=int(input()) A=list(map(int,input().split())) B=list(map(int,input().split())) print("Yes" if solve(N,A,B) else "No")