結果

問題 No.349 干支の置き物
ユーザー satanicsatanic
提出日時 2016-03-14 03:04:58
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 973 bytes
コンパイル時間 1,028 ms
コンパイル使用メモリ 87,564 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-10 21:39:22
合計ジャッジ時間 2,138 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 1 ms
4,376 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 1 ms
4,380 KB
testcase_11 AC 1 ms
4,376 KB
testcase_12 AC 1 ms
4,380 KB
testcase_13 AC 1 ms
4,380 KB
testcase_14 AC 1 ms
4,380 KB
testcase_15 AC 2 ms
4,380 KB
testcase_16 AC 1 ms
4,376 KB
testcase_17 AC 1 ms
4,380 KB
testcase_18 AC 1 ms
4,376 KB
testcase_19 AC 1 ms
4,380 KB
testcase_20 AC 1 ms
4,376 KB
testcase_21 AC 1 ms
4,380 KB
testcase_22 AC 1 ms
4,376 KB
testcase_23 AC 2 ms
4,380 KB
testcase_24 AC 1 ms
4,376 KB
testcase_25 AC 2 ms
4,380 KB
testcase_26 AC 1 ms
4,380 KB
testcase_27 AC 1 ms
4,380 KB
testcase_28 AC 2 ms
4,376 KB
testcase_29 AC 2 ms
4,376 KB
testcase_30 AC 2 ms
4,376 KB
testcase_31 AC 1 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <string>
#include <map>
#include <algorithm>
#include <cmath>

int main() {
	std::ios::sync_with_stdio(false);
	std::cin.tie(0);

	int n;
	std::string input;
	std::vector<int> count(12, 0);
	std::map<const std::string, const int> eto;
	eto.insert(std::make_pair("ne", 0));
	eto.insert(std::make_pair("ushi", 1));
	eto.insert(std::make_pair("tora", 2));
	eto.insert(std::make_pair("u", 3));
	eto.insert(std::make_pair("tatsu", 4));
	eto.insert(std::make_pair("mi", 5));
	eto.insert(std::make_pair("uma", 6));
	eto.insert(std::make_pair("hitsuji", 7));
	eto.insert(std::make_pair("saru", 8));
	eto.insert(std::make_pair("tori", 9));
	eto.insert(std::make_pair("inu", 10));
	eto.insert(std::make_pair("i", 11));

	std::cin >> n;
	for (int i = 0; i < n; ++i) {
		std::cin >> input;
		++count[eto[input]];
	}
	sort(count.begin(), count.end());
	std::cout << ((std::ceil(n / 2.0) >= count[11]) ? "YES" : "NO") << "\n";

	return 0;
}
0