結果

問題 No.349 干支の置き物
ユーザー kotamanegikotamanegi
提出日時 2016-03-11 23:56:19
言語 C++11
(gcc 11.4.0)
結果
TLE  
実行時間 -
コード長 968 bytes
コンパイル時間 1,199 ms
コンパイル使用メモリ 88,896 KB
実行使用メモリ 355,332 KB
最終ジャッジ日時 2023-10-25 06:09:24
合計ジャッジ時間 50,853 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 RE -
testcase_02 TLE -
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 TLE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 TLE -
testcase_18 RE -
testcase_19 RE -
testcase_20 TLE -
testcase_21 TLE -
testcase_22 RE -
testcase_23 TLE -
testcase_24 TLE -
testcase_25 TLE -
testcase_26 RE -
testcase_27 RE -
testcase_28 TLE -
testcase_29 RE -
testcase_30 TLE -
testcase_31 TLE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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[100000000] = {};
int main() {
	//文字列をint化してからぶち込んでソート
	int n;
	scanf("%d", &n);
	REP(i, n) {
		string hogee;
		cin >> hogee;
		int queque = 0;
		for (int q = 1;q < hogee.length() + 1;++q) {
			queque += pow(10,q)*((int)hogee[q - 1]);
		}
		hoge[queque]++;
	}
	sort(hoge, hoge + 90000000, 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