結果

問題 No.313 π
ユーザー naimonon77naimonon77
提出日時 2015-12-19 00:29:59
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 854 bytes
コンパイル時間 384 ms
コンパイル使用メモリ 51,080 KB
実行使用メモリ 4,356 KB
最終ジャッジ日時 2023-10-14 14:09:54
合計ジャッジ時間 1,979 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:33:9: warning: ‘after’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   printf("%d %d\n",before,after);
   ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:33:9: 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 main()
{
  int i;
  int n,x;
  FILE *fp;
  static char s[1000000];
  int before,after;
  int a[] = {20104,20063,19893+1,20010-1,19874,20199,19898,20163,19956,19841 };
  freopen("sample_01.txt","r",stdin);
  fgets(s,1000000,stdin);
  
  for(i=0;s[i];i++) {
    a[s[i]-'0']--;
  }
  
  for(i=0;i<10;i++) {   
    if(a[i] == 1) before = i;
    if(a[i] == -1) after = i;
  }
  printf("%d %d\n",before,after);
  /*
  fgets(s,2000000,fp);
  printf("a[] = {");
  printf("%d",a[0]);
  for(i=1;i<10;i++) {   
    printf(",%d",a[i]);
  }
  printf(" }\n");
  */
  return 0;
}
0