結果

問題 No.99 ジャンピング駒
ユーザー sotanakajimacl1sotanakajimacl1
提出日時 2017-09-30 16:33:18
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 44 ms / 5,000 ms
コード長 266 bytes
コンパイル時間 388 ms
コンパイル使用メモリ 56,380 KB
実行使用メモリ 6,940 KB
最終ジャッジ日時 2024-04-27 16:56:43
合計ジャッジ時間 1,277 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 44 ms
6,816 KB
testcase_01 AC 43 ms
6,940 KB
testcase_02 AC 44 ms
6,940 KB
testcase_03 AC 44 ms
6,940 KB
testcase_04 AC 43 ms
6,940 KB
testcase_05 AC 44 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<algorithm>
using namespace std;

int n,f1,f2;

int ze(int a){
	if(a<0) return -1*a;
	else return a;
}

int main(){
	cin>>n;
	for(int i=0;i<n;i++){
		int x;
		cin>>x;
		if(x%2==0) f1++;
		else f2++;
	}

	cout<<ze(f1-f2)<<endl;
	return 0;
}
0