結果
| 問題 |
No.99 ジャンピング駒
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-01-13 18:00:22 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 531 bytes |
| コンパイル時間 | 4,253 ms |
| コンパイル使用メモリ | 261,284 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-11-17 08:06:32 |
| 合計ジャッジ時間 | 12,873 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 2 WA * 4 |
ソースコード
//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( abs( x[i] - x[j]) % 2 == 0 ) ++cnt;
}
if( n & 1) ++cnt;
ans = min(ans , cnt);
}
cout << ans << endl;
}