結果

問題 No.349 干支の置き物
ユーザー kotamanegikotamanegi
提出日時 2016-03-11 23:51:52
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 881 bytes
コンパイル時間 952 ms
コンパイル使用メモリ 87,796 KB
実行使用メモリ 7,256 KB
最終ジャッジ日時 2023-10-25 06:04:34
合計ジャッジ時間 2,345 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
7,224 KB
testcase_01 AC 18 ms
7,224 KB
testcase_02 AC 18 ms
7,224 KB
testcase_03 AC 18 ms
7,224 KB
testcase_04 AC 19 ms
7,224 KB
testcase_05 AC 18 ms
7,224 KB
testcase_06 AC 19 ms
7,224 KB
testcase_07 AC 18 ms
7,224 KB
testcase_08 AC 19 ms
7,224 KB
testcase_09 AC 19 ms
7,224 KB
testcase_10 AC 19 ms
7,224 KB
testcase_11 AC 19 ms
7,224 KB
testcase_12 AC 19 ms
7,224 KB
testcase_13 AC 19 ms
7,224 KB
testcase_14 AC 19 ms
7,224 KB
testcase_15 AC 19 ms
7,224 KB
testcase_16 AC 19 ms
7,224 KB
testcase_17 AC 19 ms
7,224 KB
testcase_18 AC 18 ms
7,224 KB
testcase_19 AC 19 ms
7,224 KB
testcase_20 AC 19 ms
7,224 KB
testcase_21 AC 19 ms
7,224 KB
testcase_22 AC 19 ms
7,224 KB
testcase_23 AC 18 ms
7,224 KB
testcase_24 AC 19 ms
7,224 KB
testcase_25 AC 18 ms
7,224 KB
testcase_26 AC 19 ms
7,224 KB
testcase_27 AC 19 ms
7,224 KB
testcase_28 AC 19 ms
7,224 KB
testcase_29 AC 18 ms
7,224 KB
testcase_30 WA -
testcase_31 AC 18 ms
7,224 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:27:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   27 |         scanf("%d", &n);
      |         ~~~~~^~~~~~~~~~

ソースコード

diff #

#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!
0