結果
| 問題 |
No.349 干支の置き物
|
| コンテスト | |
| ユーザー |
めうめう🎒
|
| 提出日時 | 2016-03-11 22:26:52 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 771 bytes |
| コンパイル時間 | 1,009 ms |
| コンパイル使用メモリ | 75,612 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-17 07:21:33 |
| 合計ジャッジ時間 | 1,532 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 29 |
ソースコード
#include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define ll long long
#define INF (1 << 30)
#define INFLL (1LL << 60)
int main() {
int n,syu[12] = {},limit = 0;
string str;
string syurui[12] = {"ne","ushi","tora","u","tatsu","mi","uma","hitsuji","saru","tori","inu","i"};
cin >> n;
if(n % 2 == 0) limit = n / 2;
else limit = n / 2 + 1;
for(int i = 0;i < n;i++){
cin >> str;
for(int j = 0;j < 12;j++){
if(str == syurui[j]) syu[j]++;
}
}
bool ans = 0;
for(int i = 0;i < 12;i++){
if(syu[i] > limit) ans = 1;
}
if(ans) cout << "NO" << endl;
else cout << "YES" << endl;
return 0;
}
めうめう🎒