結果

問題 No.99 ジャンピング駒
ユーザー おきょん.おきょん.
提出日時 2022-01-13 18:02:59
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 547 bytes
コンパイル時間 4,460 ms
コンパイル使用メモリ 259,508 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-10 22:20:03
合計ジャッジ時間 13,312 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,211 ms
4,376 KB
testcase_01 AC 1,173 ms
4,376 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

//No.99 ジャンピング駒
#pragma GCC optimize("O3")
#pragma GCC target("avx")
#include <bits/stdc++.h>
#define rep(i ,n) for(int i=0;i<(int)(n);++i)

using namespace std;

signed main(){
    int n; cin >>n;
    vector<int> x(n);
    rep( i , n ) cin >> x[i];
    int ans = (int)10e8; 
    int cnt;
    rep( i , n ){
        cnt = 0;
        for( int j = i + 1 ; j < n ; ++j){
            if( ( x[i] - x[j]) % 2 == 0 && x[i] - x[j] == 0) ++cnt;
        }
        if( n & 1) ++cnt;
        ans = min(ans , cnt);
    }
    cout << ans << endl;
}
0