結果

問題 No.313 π
ユーザー moyashi_senpaimoyashi_senpai
提出日時 2016-08-19 10:33:26
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 12 ms / 5,000 ms
コード長 767 bytes
コンパイル時間 588 ms
コンパイル使用メモリ 78,080 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-25 08:00:16
合計ジャッジ時間 2,029 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <cstdio>
#include <vector>
#include <cmath>
#include <cstring>
#include <numeric>
#include <algorithm>
#include <functional>
#include <array>
#include <map>
#include <queue>
#include <limits.h>
#include <set>
#include <stack>
#define REP(i,n) for(int i = 0; n > i; i++)

using namespace std;
typedef vector<int> Ivec;
typedef pair<int, int> pii;

int main() {
	array<int, 10> count = { 
		20104
		,20063
		,19892
		,20011
		,19874
		,20199
		,19898
		,20163
		,19956
		,19841
	}, ansho = {};

	

	REP(i, 200002) {
		char c;
		scanf("%c", &c);
		if (c == '.')continue;
		ansho[c - '0']++;
	}
	int bef, af;
	REP(i,10) {
		if (count[i] < ansho[i]) bef = i;
		else if (count[i] > ansho[i]) af = i;
	}
	printf("%d %d\n", bef, af);
	return 0;
}
0