結果
問題 | No.905 Sorted? |
ユーザー |
![]() |
提出日時 | 2019-10-11 22:42:30 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 981 bytes |
コンパイル時間 | 153 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 22,552 KB |
最終ジャッジ日時 | 2024-11-25 08:35:25 |
合計ジャッジ時間 | 8,702 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 14 WA * 9 |
ソースコード
N = int(input()) A = list(map(int,input().split())) dec = [1]*N c = 1 f = True for i in range(1,N) : if A[i-1] >= A[i] : if not f : f = True c += 1 dec[i-1] = c dec[i] = c else : dec[i] = c else : dec[i] = False f = False inc = [1]*N c = 1 f = True for i in range(1,N) : if A[i-1] <= A[i] : if not f : f = True c += 1 inc[i-1] = c inc[i] = c else : inc[i] = c else : inc[i] = False f = False for i in range(int(input())) : p,q = map(int,input().split()) if (inc[p] == False) or (inc[q] == False) : x = 0 elif inc[p] == inc[q] : x = 1 else : x = 0 if (dec[p] == False) or (dec[q] == False) : y = 0 #print(p,q,dec[p],dec[q]) elif dec[p] == dec[q] : y = 1 else : y = 0 print(x,y)