結果
| 問題 |
No.99 ジャンピング駒
|
| コンテスト | |
| ユーザー |
not_522
|
| 提出日時 | 2015-07-14 21:07:12 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 38 ms / 5,000 ms |
| コード長 | 696 bytes |
| コンパイル時間 | 1,410 ms |
| コンパイル使用メモリ | 157,792 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-08 07:17:59 |
| 合計ジャッジ時間 | 2,290 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 6 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
template<typename T> inline T gcd(T a, T b) {
return __gcd(a, b);
}
template<typename T> inline T lcm(T a, T b) {
return a / gcd(a, b) * b;
}
template<typename T> inline T floor(T a, T b) {
return a / b * b <= a ? a / b : a / b - 1;
}
template<typename T> inline T ceil(T a, T b) {
return floor(a + b - 1, b);
}
template<typename T> inline T round(T a, T b) {
return floor(a + b / 2);
}
template<typename T> inline T mod(T a, T b) {
return a - floor(a, b) * b;
}
int main() {
int n;
cin >> n;
int a[2]{};
for (int i = 0; i < n; ++i) {
int x;
cin >> x;
++a[mod(x, 2)];
}
cout << abs(a[0] - a[1]) << endl;
}
not_522