結果
| 問題 | No.313 π |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-06-22 19:42:09 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 27 ms / 5,000 ms |
| コード長 | 746 bytes |
| コンパイル時間 | 631 ms |
| コンパイル使用メモリ | 58,992 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-11 19:23:28 |
| 合計ジャッジ時間 | 2,627 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 32 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:37:23: warning: ‘t’ may be used uninitialized in this function [-Wmaybe-uninitialized]
37 | cout << f << " " << t << endl;
| ^
main.cpp:37:16: warning: ‘f’ may be used uninitialized in this function [-Wmaybe-uninitialized]
37 | cout << f << " " << t << endl;
| ^~~
ソースコード
#include <iostream>
#include <string>
#include <sstream>
using namespace std;
int nums[10] = {20104,20063,19892,20011,19874,20199,19898,20163,19956,19841};
int main()
{
stringstream ss;
string ispi; cin >> ispi;
int count[10] = {0};
int n;
ss << ispi[0];
ss >> n;
count[n] += 1;
ss.clear(); // 状態をクリア.
ss.str(""); // 文字列をクリア.
for (int i = 2; i < ispi.size(); i++) {
string tmp;
tmp = ispi[i];
ss << tmp;
ss >> n;
count[n] += 1;
ss.clear(); // 状態をクリア.
ss.str(""); // 文字列をクリア.
}
int f,t;
for(int i = 0; i < 10; i++){
if(count[i] < nums[i]) t = i;
if(count[i] > nums[i]) f = i;
}
cout << f << " " << t << endl;
return 0;
}