結果
問題 |
No.349 干支の置き物
|
ユーザー |
![]() |
提出日時 | 2016-08-18 23:43:36 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 363 bytes |
コンパイル時間 | 910 ms |
コンパイル使用メモリ | 69,700 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-17 07:37:47 |
合計ジャッジ時間 | 1,604 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 29 |
ソースコード
#include <iostream> #include <string> #include <map> using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); int N; cin >> N; int key = N / 2 + N % 2; map<string, int> zodiac; for (int i = 0;i < N;i++) { string s; cin >> s; zodiac[s]++; if (zodiac[s] > key) { cout << "NO" << endl; return 0; } } cout << "YES" << endl; return 0; }