結果

問題 No.905 Sorted?
ユーザー convexineqconvexineq
提出日時 2021-04-10 20:50:38
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 390 ms / 2,000 ms
コード長 344 bytes
コンパイル時間 2,208 ms
コンパイル使用メモリ 86,708 KB
実行使用メモリ 108,260 KB
最終ジャッジ日時 2023-09-08 16:35:12
合計ジャッジ時間 8,510 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 66 ms
71,376 KB
testcase_01 AC 68 ms
71,236 KB
testcase_02 AC 70 ms
71,420 KB
testcase_03 AC 67 ms
71,268 KB
testcase_04 AC 66 ms
71,192 KB
testcase_05 AC 92 ms
76,476 KB
testcase_06 AC 81 ms
76,464 KB
testcase_07 AC 98 ms
77,572 KB
testcase_08 AC 346 ms
88,904 KB
testcase_09 AC 270 ms
89,320 KB
testcase_10 AC 330 ms
95,960 KB
testcase_11 AC 339 ms
100,624 KB
testcase_12 AC 373 ms
97,624 KB
testcase_13 AC 351 ms
107,272 KB
testcase_14 AC 366 ms
106,972 KB
testcase_15 AC 385 ms
107,788 KB
testcase_16 AC 390 ms
108,260 KB
testcase_17 AC 385 ms
108,204 KB
testcase_18 AC 317 ms
108,144 KB
testcase_19 AC 66 ms
71,328 KB
testcase_20 AC 66 ms
71,452 KB
testcase_21 AC 67 ms
71,520 KB
testcase_22 AC 73 ms
71,092 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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))
0