結果

問題 No.2089 置換の符号
ユーザー ripityripity
提出日時 2022-09-30 21:35:18
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 187 bytes
コンパイル時間 346 ms
コンパイル使用メモリ 10,680 KB
実行使用メモリ 13,528 KB
最終ジャッジ日時 2023-08-24 14:56:23
合計ジャッジ時間 6,523 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,888 KB
testcase_01 AC 15 ms
7,788 KB
testcase_02 AC 15 ms
7,716 KB
testcase_03 AC 15 ms
7,800 KB
testcase_04 AC 15 ms
7,784 KB
testcase_05 AC 14 ms
7,880 KB
testcase_06 AC 15 ms
7,756 KB
testcase_07 AC 15 ms
7,908 KB
testcase_08 AC 15 ms
7,844 KB
testcase_09 AC 15 ms
7,788 KB
testcase_10 AC 15 ms
7,804 KB
testcase_11 AC 14 ms
7,756 KB
testcase_12 AC 15 ms
7,924 KB
testcase_13 AC 15 ms
7,840 KB
testcase_14 AC 15 ms
7,920 KB
testcase_15 AC 15 ms
7,880 KB
testcase_16 AC 14 ms
7,812 KB
testcase_17 AC 14 ms
7,764 KB
testcase_18 AC 15 ms
7,880 KB
testcase_19 AC 15 ms
7,880 KB
testcase_20 AC 15 ms
7,800 KB
testcase_21 AC 15 ms
7,876 KB
testcase_22 AC 16 ms
7,716 KB
testcase_23 AC 38 ms
7,912 KB
testcase_24 AC 70 ms
7,836 KB
testcase_25 AC 112 ms
7,764 KB
testcase_26 AC 158 ms
7,884 KB
testcase_27 AC 1,165 ms
8,204 KB
testcase_28 TLE -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

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