結果
| 問題 | 
                            No.349 干支の置き物
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2020-06-24 23:22:40 | 
| 言語 | C++14  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 515 bytes | 
| コンパイル時間 | 1,721 ms | 
| コンパイル使用メモリ | 177,696 KB | 
| 実行使用メモリ | 6,948 KB | 
| 最終ジャッジ日時 | 2024-07-03 20:26:41 | 
| 合計ジャッジ時間 | 2,980 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 26 WA * 3 | 
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:23:20: warning: init-statement in selection statements only available with '-std=c++17' or '-std=gnu++17' [-Wc++17-extensions]
   23 |                 if(auto itr=mp.find(s); itr!=end(mp)){
      |                    ^~~~
main.cpp:28:24: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17' [-Wc++17-extensions]
   28 |         for(const auto&[key,value]:mp){
      |                        ^
            
            ソースコード
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
int main(){
	map<string, int> mp{
		{"ne",0},
		{"ushi",0},
		{"tora",0},
		{"u",0},
		{"tatsu",0},
		{"mi",0},
		{"uma",0},
		{"hitsuji",0},
		{"saru",0},
		{"tori",0},
		{"inu",0},
		{"i",0}
	};
	int n; cin>>n;
	rep(i,n){
		string s; cin>>s;
		if(auto itr=mp.find(s); itr!=end(mp)){
			itr->second++;
		}
	}
	bool flg=true;
	for(const auto&[key,value]:mp){
		if(flg&&value>n/2) flg=false;
	}
	cout<<(flg?"YES":"NO")<<endl;
}