結果

問題 No.313 π
ユーザー naimonon77naimonon77
提出日時 2015-12-19 00:50:13
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 1,006 bytes
コンパイル時間 387 ms
コンパイル使用メモリ 51,312 KB
実行使用メモリ 4,356 KB
最終ジャッジ日時 2023-10-14 14:10:10
合計ジャッジ時間 2,251 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 1 ms
4,352 KB
testcase_04 AC 1 ms
4,348 KB
testcase_05 AC 2 ms
4,352 KB
testcase_06 AC 2 ms
4,352 KB
testcase_07 AC 1 ms
4,348 KB
testcase_08 AC 2 ms
4,348 KB
testcase_09 AC 1 ms
4,348 KB
testcase_10 AC 1 ms
4,352 KB
testcase_11 AC 2 ms
4,348 KB
testcase_12 AC 1 ms
4,352 KB
testcase_13 AC 1 ms
4,348 KB
testcase_14 AC 1 ms
4,348 KB
testcase_15 AC 2 ms
4,352 KB
testcase_16 AC 1 ms
4,348 KB
testcase_17 AC 2 ms
4,352 KB
testcase_18 AC 1 ms
4,348 KB
testcase_19 AC 2 ms
4,348 KB
testcase_20 AC 1 ms
4,348 KB
testcase_21 AC 2 ms
4,352 KB
testcase_22 AC 2 ms
4,352 KB
testcase_23 AC 2 ms
4,348 KB
testcase_24 AC 2 ms
4,348 KB
testcase_25 AC 1 ms
4,348 KB
testcase_26 AC 2 ms
4,356 KB
testcase_27 AC 2 ms
4,348 KB
testcase_28 AC 1 ms
4,352 KB
testcase_29 AC 2 ms
4,352 KB
testcase_30 AC 1 ms
4,348 KB
testcase_31 AC 2 ms
4,348 KB
testcase_32 AC 1 ms
4,352 KB
testcase_33 AC 1 ms
4,352 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:36:11: warning: ‘after’ may be used uninitialized in this function [-Wmaybe-uninitialized]
     printf("%d %d\n",before,after);
     ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:36:11: warning: ‘before’ may be used uninitialized in this function [-Wmaybe-uninitialized]

ソースコード

diff #

#include <iostream>
#include <cstdio>
#define REP(i,a,b) for(i=a;i<b;i++)
#define rep(i,n) REP(i,0,n)
#define MOD1 1000000007;
#define MOD2 1000007
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
/* ここからが本編 */
/*  */
int test = 0;
int main()
{
  int i;
  int n,x;
  FILE *fp;
  static char s[1000000];
  int before,after;
  int a[10] = {20104,20063,19893-1,20010+1,19874,20199,19898,20163,19956,19841};
  //freopen("sample_02.txt","r",stdin);
  fgets(s,1000000,stdin);
  if(test == 0) {
    a[s[0]-'0']--;

    for(i=2;s[i] != '\n';i++) {
      a[s[i]-'0']--;
    }

    for(i=0;i<10;i++) {   
      if(a[i] == 1) after = i;
      if(a[i] == -1) before = i;
    }
    printf("%d %d\n",before,after);

  }
  if(test) {
    a[s[0]-'0']++;

    for(i=2;s[i] != '\n';i++) {
      a[s[i]-'0']++;
    }

    printf("a[] = {");
    printf("%d",a[0]);
    for(i=1;i<10;i++) {   
      printf(",%d",a[i]);
    }
    printf(" }\n");
  }
  return 0;
}
0