結果
| 問題 |
No.2089 置換の符号
|
| コンテスト | |
| ユーザー |
ripity
|
| 提出日時 | 2022-09-30 21:35:18 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 187 bytes |
| コンパイル時間 | 112 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 21,888 KB |
| 最終ジャッジ日時 | 2024-12-22 22:37:29 |
| 合計ジャッジ時間 | 18,639 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 28 TLE * 5 |
ソースコード
N = int(input())
A = list(map(int, input().split()))
cnt = 0
for i in range(N):
for j in range(N):
if i < j and A[i] > A[j]: cnt += 1
if cnt%2 == 0: print(1)
else: print(-1)
ripity