結果

問題 No.349 干支の置き物
コンテスト
ユーザー hotpepsi
提出日時 2016-03-12 00:17:06
言語 C++11
(gcc 15.3.0 + boost 1.92.0)
コンパイル:
g++-15 -O2 -lm -std=gnu++11 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 369 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 547 ms
コンパイル使用メモリ 85,884 KB
実行使用メモリ 6,272 KB
最終ジャッジ日時 2026-09-03 16:03:41
合計ジャッジ時間 2,413 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 26 WA * 3
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#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 / 2) {
			possible = false;
		}
	}
	cout << (possible ? "YES" : "NO") << endl;
	return 0;
}
0