結果

問題 No.313 π
ユーザー graphegraphe
提出日時 2019-04-30 19:07:47
言語 C++11
(gcc 13.3.0)
結果
AC  
実行時間 7 ms / 5,000 ms
コード長 403 bytes
コンパイル時間 514 ms
コンパイル使用メモリ 55,636 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-30 21:52:34
合計ジャッジ時間 2,788 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 32
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:14:21: warning: ‘a’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   14 |   std::cout << a << " " << b << std::endl;
      |                     ^~~
main.cpp:14:28: warning: ‘b’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   14 |   std::cout << a << " " << b << std::endl;
      |                            ^

ソースコード

diff #

#include <iostream>
int main(void){
  int y[10] = {20104, 20063, 19892, 20011, 19874, 20199, 19898, 20163, 19956, 19841}, b, a;
  std::string s;
  std::cin >> s;
  int l = s.size();
  for(int i = 0; i < l; i++){
    if(s[i] != '.') y[(int)(s[i] - '0')]--;
  }
  for(int i = 0; i < 10; i++){
    if(y[i] == 1) b = i;
    if(y[i] == -1) a = i;
  }
  std::cout << a << " " << b << std::endl;
  return 0;
}
0