結果

問題 No.2029 Swap Min Max Min
ユーザー ruthenruthen
提出日時 2022-08-05 22:33:55
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 573 bytes
コンパイル時間 1,932 ms
コンパイル使用メモリ 199,496 KB
実行使用メモリ 4,356 KB
最終ジャッジ日時 2023-10-14 00:12:16
合計ジャッジ時間 4,449 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 7 ms
4,352 KB
testcase_06 AC 14 ms
4,348 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 5 ms
4,352 KB
testcase_11 WA -
testcase_12 AC 9 ms
4,352 KB
testcase_13 WA -
testcase_14 AC 21 ms
4,352 KB
testcase_15 WA -
testcase_16 AC 20 ms
4,348 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 20 ms
4,348 KB
testcase_20 AC 21 ms
4,352 KB
testcase_21 AC 20 ms
4,348 KB
testcase_22 AC 20 ms
4,352 KB
testcase_23 WA -
testcase_24 AC 19 ms
4,348 KB
testcase_25 AC 19 ms
4,348 KB
testcase_26 AC 19 ms
4,356 KB
testcase_27 WA -
testcase_28 AC 2 ms
4,352 KB
testcase_29 AC 2 ms
4,352 KB
testcase_30 AC 2 ms
4,348 KB
testcase_31 AC 1 ms
4,348 KB
testcase_32 WA -
testcase_33 AC 2 ms
4,348 KB
testcase_34 WA -
testcase_35 AC 2 ms
4,348 KB
testcase_36 AC 2 ms
4,348 KB
testcase_37 WA -
testcase_38 WA -
testcase_39 AC 19 ms
4,348 KB
testcase_40 AC 17 ms
4,348 KB
testcase_41 AC 17 ms
4,348 KB
testcase_42 AC 18 ms
4,348 KB
testcase_43 AC 18 ms
4,348 KB
testcase_44 AC 19 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

#ifdef _RUTHEN
#include "debug.hpp"
#else
#define show(...) true
#endif

using ll = long long;
#define rep(i, n) for (int i = 0; i < (n); i++)
template <class T> using V = vector<T>;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int N;
    cin >> N;
    V<int> A(N);
    rep(i, N) cin >> A[i];
    ll ans = 0;
    int cnt = 0;
    rep(i, N) {
        if (A[i] <= N / 2) {
            ans += abs(i - 2 * cnt - 1);
            cnt++;
        }
    }
    cout << N / 2 << ' ' << ans << '\n';
    return 0;
}
0