結果

問題 No.313 π
ユーザー kou6839kou6839
提出日時 2016-04-13 14:39:03
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 8 ms / 5,000 ms
コード長 2,787 bytes
コンパイル時間 987 ms
コンパイル使用メモリ 103,700 KB
実行使用メモリ 7,880 KB
最終ジャッジ日時 2024-04-15 00:40:37
合計ジャッジ時間 2,814 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 7 ms
7,876 KB
testcase_01 AC 7 ms
7,748 KB
testcase_02 AC 7 ms
7,876 KB
testcase_03 AC 7 ms
7,748 KB
testcase_04 AC 7 ms
7,744 KB
testcase_05 AC 8 ms
7,744 KB
testcase_06 AC 7 ms
7,872 KB
testcase_07 AC 7 ms
7,876 KB
testcase_08 AC 7 ms
7,748 KB
testcase_09 AC 7 ms
7,872 KB
testcase_10 AC 7 ms
7,876 KB
testcase_11 AC 7 ms
7,876 KB
testcase_12 AC 7 ms
7,876 KB
testcase_13 AC 6 ms
7,748 KB
testcase_14 AC 7 ms
7,880 KB
testcase_15 AC 7 ms
7,744 KB
testcase_16 AC 7 ms
7,752 KB
testcase_17 AC 7 ms
7,748 KB
testcase_18 AC 7 ms
7,748 KB
testcase_19 AC 7 ms
7,876 KB
testcase_20 AC 7 ms
7,872 KB
testcase_21 AC 7 ms
7,752 KB
testcase_22 AC 7 ms
7,748 KB
testcase_23 AC 7 ms
7,876 KB
testcase_24 AC 7 ms
7,876 KB
testcase_25 AC 7 ms
7,748 KB
testcase_26 AC 7 ms
7,880 KB
testcase_27 AC 7 ms
7,876 KB
testcase_28 AC 7 ms
7,744 KB
testcase_29 AC 7 ms
7,872 KB
testcase_30 AC 7 ms
7,876 KB
testcase_31 AC 7 ms
7,748 KB
testcase_32 AC 7 ms
7,872 KB
testcase_33 AC 7 ms
7,876 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:152:25: warning: ‘ans2’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  152 |         cout << ans2 << " " << ans1 << endl;
      |                         ^~~
main.cpp:152:32: warning: ‘ans1’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  152 |         cout << ans2 << " " << ans1 << endl;
      |                                ^~~~

ソースコード

diff #

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<ctime>
#include<cctype>
#include<climits>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<list>
#include<queue>
#include<fstream>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<memory>
#include<functional>

using namespace std;

#define all(g) (g).begin(),(g).end()
#define REP(i, x, n) for(int i = x; i < n; i++)
#define rep(i,n) REP(i,0,n)
#define F(i,j,k) fill(i[0],i[0]+j*j,k)
#define P(p) cout<<(p)<<endl;
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define INF (1<<28)
#define pb push_back

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<long long> vl;
typedef vector<double> vd;
typedef pair<int, int> pii;
typedef pair<long, long> pll;
typedef long long ll;

int gcd(int a, int b) {
	if (b == 0) return a;
	return gcd(b, a % b);
}

int lcm(int a, int b) {
	return a / gcd(a, b) * b;
}

int extgcd(int a, int b, int& x, int& y) {
	int d = a;
	if (b != 0) {
		d = extgcd(b, a % b, y, x);
		y -= (a / b) * x;
	}
	else {
		x = 1; y = 0;
	}
	return d;
}

bool is_prime(ll n) {
	if (n == 2) return true;
	if (n % 2 == 0) return false;
	for (ll i = 3; i * i <= n; i+=2) {
		if (n % i == 0) return false;
	}
	return n != 1;
}

vector<int> divisor(int n) {
	vector<int> res;
	for (int i = 1; i * i <= n; i++) {
		if (n % i == 0) {
			res.pb(i);
			if (i != n / i) res.pb(n / i);
		}
	}
	return res;
}

map<int, int> prime_factor(int n) {
	map<int, int> res;
	for (int i = 2; i * i <= n; i++) {
		while (n % i == 0) {
			++res[i];
			n /= i;
		}
	}
	if (n != 1) res[n] = 1;
	return res;
}

const int MAX_N = 10000000;
int prime[MAX_N];
bool memo[MAX_N + 1];
long long MOD = 1000000007ll;
ll mod_pow(ll x, ll n, ll mod) {
	if (n == 0) return 1;
	ll res = mod_pow(x * x % mod, n / 2, mod);
	if (n & 1) res = res * x % mod;
	return res;
}

vector<int> G[100005];
int dp1[1000005], dp2[100005];
void dfs(int p, int x) {
	vi child;
	for (int v : G[x]) {
		if (v != p) child.push_back(v);
	}

	for (int v : child)dfs(x, v);

	ll prod = 1;
	for (int v : child) prod = prod*dp1[v] % MOD;
	dp2[x] = prod;

	ll prod2 = 1;
	for (int v : child) prod2 = prod2*dp2[v] % MOD;
	dp1[x] = (dp2[x] + prod2) % MOD;
}
int trans(int n) {
	int ret = 0;
	while(n > 0) {
		ret += (n % 10)*(n % 10);
		n /= 10;
	}
	return ret;
}
int main() {
	int count2[10];
	int count[] = { 20104, 20063, 19892, 20011, 19874,
		20199, 19898, 20163, 19956, 19841 };
	string inp;
	cin >> inp;
	rep(i,inp.size()) {
		int a2 = (int)(inp[i] - '0');
		count2[a2]++;
	}
	int ans1, ans2;
	rep(i, 10) {
		if (count[i] > count2[i]) {
			ans1 = i;
		}
		if (count[i] < count2[i]) {
			ans2 = i;
		}
	}
	cout << ans2 << " " << ans1 << endl;
	return 0;
}
0