結果

問題 No.349 干支の置き物
ユーザー hotpepsihotpepsi
提出日時 2016-03-12 00:20:28
言語 C++11
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 375 bytes
コンパイル時間 795 ms
コンパイル使用メモリ 69,616 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-17 07:24:49
合計ジャッジ時間 1,502 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 29
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <sstream>
#include <map>
#include <cstdint>

using namespace std;

int main(int argc, char *argv[])
{
	int N;
	cin >> N;
	map<string, int> m;
	bool possible = true;
	for (int i = 0; i < N; ++i) {
		string s;
		cin >> s;
		m[s] += 1;
		if (m[s] > (N + 1) / 2) {
			possible = false;
		}
	}
	cout << (possible ? "YES" : "NO") << endl;
	return 0;
}
0