結果

問題 No.349 干支の置き物
ユーザー togatoga
提出日時 2016-04-25 20:09:43
言語 JavaScript
(node v23.5.0)
結果
WA  
実行時間 -
コード長 399 bytes
コンパイル時間 89 ms
コンパイル使用メモリ 6,824 KB
実行使用メモリ 41,580 KB
最終ジャッジ日時 2024-10-12 23:39:05
合計ジャッジ時間 3,223 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 24 WA * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

function Main(input) {
	input = input.split("\n");
	var N = parseInt(input[0], 10);
	var deg = {};
	for (var i = 1; i <= N; i++){
		var tmp = input[i];
		deg[tmp] = deg[tmp] + 1;

	}
	ok = true;
	for (var key in deg){
		if (deg[key] > Math.floor(N / 2)){
			ok = false;
		}
	}
	if (ok){
		console.log("YES");
	}else{
		console.log("NO");
	}
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
0