結果

問題 No.99 ジャンピング駒
ユーザー bdisheoshepehabdisheoshepeha
提出日時 2018-12-20 14:14:31
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 640 bytes
コンパイル時間 651 ms
コンパイル使用メモリ 73,548 KB
実行使用メモリ 8,640 KB
最終ジャッジ日時 2023-10-26 00:59:08
合計ジャッジ時間 13,234 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include<iostream>
#include<vector>
#include<stdlib.h>
int main(){
	int size=0;
	std::cin>>size;
	std::vector<int> flg(size);
	std::vector<int> array(size);
	for(int i=0;i<size;i++){
		std::cin>>array[i];
	}
	int temp=0;
	for(int i=0; i<size; i++){
		for(int j=size-1; j>i; j--){
			if(array[j] < array[j-1]){
				temp = array[j];
		        array[j] = array[j-1];
		        array[j-1] = temp;
		    }
		}
	}

	for(int i=0;i<size;i++){
		if(flg[i]==0){
			int hoge=0;
			hoge=abs(array[i]-array[i+1]);
			if(hoge%2)flg[i]=1;flg[i+1]=1;
		}

	}
	int yuyu=0;
	for(int n=0;n<size;n++){
		if(flg[n]==0)yuyu++;
	}
	printf("%d",yuyu);
	return 0;
}
0