結果
| 問題 |
No.905 Sorted?
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-10-11 22:49:55 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 735 bytes |
| コンパイル時間 | 395 ms |
| コンパイル使用メモリ | 12,416 KB |
| 実行使用メモリ | 42,096 KB |
| 最終ジャッジ日時 | 2024-11-25 08:49:02 |
| 合計ジャッジ時間 | 27,923 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 15 TLE * 8 |
ソースコード
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()