結果
| 問題 | No.349 干支の置き物 |
| コンテスト | |
| ユーザー |
kotamanegi
|
| 提出日時 | 2016-03-11 23:51:52 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 881 bytes |
| 記録 | |
| コンパイル時間 | 562 ms |
| コンパイル使用メモリ | 108,168 KB |
| 実行使用メモリ | 7,552 KB |
| 最終ジャッジ日時 | 2026-04-12 05:05:43 |
| 合計ジャッジ時間 | 1,992 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 28 WA * 1 |
ソースコード
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <math.h>
#include <iterator>
#include <iomanip>
#include <vector>
#include <string>
#include <set>
#include <math.h>
#include <iostream>
#include<map>
#include <list>
#include <typeinfo>
using namespace std;
#define REP(a,b) for(long long a = 0;a < b;++a)
int hoge[1000000] = {};
int main() {
//文字列をint化してからぶち込んでソート
int n;
scanf("%d", &n);
REP(i, n) {
string hogee;
cin >> hogee;
hoge[1000 * (int)hogee[0] + (int)hogee[1]]++;
}
sort(hoge, hoge + 900000, greater<int>());
int ans = n / 2;
if (n % 2 == 1) ans++;
if (ans >= hoge[0]) {
cout << "YES" << endl;
}
else {
cout << "NO" << endl;
}
}
//thank you for reading my code!
kotamanegi