結果

問題 No.313 π
ユーザー tnakao0123
提出日時 2016-04-03 02:40:01
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 960 bytes
コンパイル時間 688 ms
コンパイル使用メモリ 84,308 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-10-02 12:33:51
合計ジャッジ時間 2,849 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 2
other AC * 1 WA * 31
権限があれば一括ダウンロードができます

ソースコード

diff #

/* -*- coding: utf-8 -*-
 *
 * 313.cc: No.313 π - yukicoder
 */

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>
 
using namespace std;

/* constant */

const int N = 200001;

const int pics[] = {
  20099, 20060, 19929, 20006, 19869,
  20195, 19895, 20159, 19951, 19838
};

/* typedef */

/* global variables */

int cs[10];

/* subroutines */

/* main */

int main() {
  int cnt = 0;
  for (;;) {
    char ch;
    cin >> ch;
    if (ch >= '0' && ch <= '9') {
      cnt++;
      cs[ch - '0']++;
      if (cnt >= N) break;
    }
  }

  int ft, tt;
  for (int i = 0; i < 10; i++) {
    if (cs[i] < pics[i]) ft = i;
    else if (cs[i] > pics[i]) tt = i;
  }

  printf("%d %d\n", ft, tt);
  return 0;
}
0