結果
問題 |
No.905 Sorted?
|
ユーザー |
![]() |
提出日時 | 2021-04-10 20:50:38 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 371 ms / 2,000 ms |
コード長 | 344 bytes |
コンパイル時間 | 208 ms |
コンパイル使用メモリ | 82,268 KB |
実行使用メモリ | 107,420 KB |
最終ジャッジ日時 | 2024-06-26 09:25:46 |
合計ジャッジ時間 | 6,333 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 23 |
ソースコード
n = int(input()) *a, = map(int,input().split()) inc = [0] + [int(i<=j) for i,j in zip(a,a[1:])] dec = [0] + [int(i>=j) for i,j in zip(a,a[1:])] for i in range(1,n): inc[i] += inc[i-1] dec[i] += dec[i-1] Q = int(input()) for _ in range(Q): L,R = map(int,input().split()) print(int(inc[R]-inc[L] == R-L),int(dec[R]-dec[L] == R-L))