結果

問題 No.2029 Swap Min Max Min
ユーザー ShirotsumeShirotsume
提出日時 2022-06-14 22:43:52
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 471 bytes
コンパイル時間 1,810 ms
コンパイル使用メモリ 87,076 KB
実行使用メモリ 113,092 KB
最終ジャッジ日時 2023-10-14 00:00:44
合計ジャッジ時間 9,196 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,300 KB
testcase_01 AC 72 ms
71,476 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 92 ms
86,560 KB
testcase_06 AC 112 ms
100,400 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 85 ms
80,660 KB
testcase_11 WA -
testcase_12 AC 97 ms
89,924 KB
testcase_13 WA -
testcase_14 AC 122 ms
107,164 KB
testcase_15 WA -
testcase_16 AC 123 ms
112,596 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 122 ms
106,804 KB
testcase_20 AC 121 ms
107,064 KB
testcase_21 AC 123 ms
107,048 KB
testcase_22 AC 125 ms
112,644 KB
testcase_23 AC 123 ms
112,996 KB
testcase_24 WA -
testcase_25 AC 121 ms
113,008 KB
testcase_26 AC 123 ms
107,132 KB
testcase_27 AC 72 ms
71,316 KB
testcase_28 AC 73 ms
71,216 KB
testcase_29 AC 73 ms
71,472 KB
testcase_30 AC 73 ms
71,372 KB
testcase_31 AC 73 ms
71,360 KB
testcase_32 WA -
testcase_33 AC 73 ms
71,372 KB
testcase_34 AC 72 ms
71,320 KB
testcase_35 AC 73 ms
71,356 KB
testcase_36 AC 73 ms
71,132 KB
testcase_37 AC 72 ms
70,944 KB
testcase_38 AC 113 ms
108,140 KB
testcase_39 AC 121 ms
112,772 KB
testcase_40 AC 114 ms
108,072 KB
testcase_41 WA -
testcase_42 WA -
testcase_43 AC 124 ms
113,092 KB
testcase_44 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

def solve(n, a):
    x = n // 2
    y = 0
    ind = []
    for i in range(n):
        if a[i] <= x:
            ind.append(i)
    if n % 2 == 1:
        for i, v in enumerate(ind):
            y += abs(v - (2 * i + 1))
    else:
        y1 = 0
        y2 = 0
        for i, v in enumerate(ind):
            y1 += abs(v - (2 * i + 1))
            y2 += abs(v - 2 * i)
        y = y2
    return x, y

n = int(input())
a = list(map(int,input().split()))

print(*solve(n, a))
0