結果
| 問題 | No.905 Sorted? |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-10-11 22:49:55 |
| 言語 | Python3 (3.15.2 + numpy 2.5.4 + scipy 1.18.1 + ACL) |
| 結果 |
TLE
不安定
|
| 実行時間 | - |
| コード長 | 735 bytes |
| 記録 | |
| コンパイル時間 | 61 ms |
| コンパイル使用メモリ | 15,104 KB |
| 実行使用メモリ | 16,396 KB |
| 最終ジャッジ日時 | 2026-09-29 19:15:39 |
| 合計ジャッジ時間 | 7,207 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge4_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 8 TLE * 1 -- * 14 |
ソースコード
import sys
stdin = sys.stdin
ns = lambda : stdin.readline().rstrip()
ni = lambda : int(ns())
na = lambda : list(map(int, stdin.readline().split()))
def main():
n = ni()
a = na()
q = ni()
for _ in range(q):
l, r = na()
gcnt = 0
lcnt = 0
ecnt = 0
for i in range(l, r):
if a[i] <= a[i+1]:
gcnt += 1
if a[i] >= a[i+1]:
lcnt += 1
if a[i] == a[i+1]:
ecnt += 1
c = r - l
if gcnt == c:
if ecnt == c:
print(1, 1)
continue
print(1, 0)
if lcnt == c:
if ecnt == c:
print(1, 1)
continue
print(0, 1)
if ecnt == c:
print(1, 1)
if gcnt != c and lcnt != c and ecnt != c:
print(0, 0)
main()