結果

問題 No.349 干支の置き物
ユーザー square1001
提出日時 2016-10-29 18:32:28
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 307 bytes
コンパイル時間 1,760 ms
コンパイル使用メモリ 176,076 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-11-24 18:20:28
合計ジャッジ時間 2,734 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 29
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
int n; string s; map<string, int> d;
int main() {
	cin >> n;
	for(int i = 0; i < n; i++) {
		cin >> s;
		d[s]++;
	}
	bool ok = true;
	for(pair<string, int> i : d) {
		if(i.second > n / 2 + n % 2) ok = false;
	}
	cout << (ok ? "YES" : "NO") << endl;
	return 0;
}
0