結果
| 問題 | No.313 π |
| コンテスト | |
| ユーザー |
xyz600600
|
| 提出日時 | 2016-02-14 10:07:15 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 4 ms / 5,000 ms |
| コード長 | 602 bytes |
| 記録 | |
| コンパイル時間 | 425 ms |
| コンパイル使用メモリ | 81,572 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-04-10 12:19:15 |
| 合計ジャッジ時間 | 1,914 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 32 |
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:23:7: warning: 'a' is used uninitialized [-Wuninitialized]
23 | int a, b;
| ^
main.cpp:23:10: warning: 'b' is used uninitialized [-Wuninitialized]
23 | int a, b;
| ^
ソースコード
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
vector<int> hist_ans = {20104, 20063, 19892, 20011, 19874, 20199, 19898, 20163, 19956, 19841};
vector<int> hist_in( 10 );
fill( hist_in.begin(), hist_in.end(), 0 );
string line;
getline( cin, line );
for ( char ch : line )
{
if ( '0' <= ch && ch <= '9' )
{
hist_in[ ch - '0' ]++;
}
}
int a, b;
for ( int i = 0; i <= 9; i++ )
{
if ( hist_ans[ i ] < hist_in[ i ] )
{
a = i;
}
else if ( hist_ans[ i ] > hist_in[ i ] )
{
b = i;
}
}
cout << a << " " << b << endl;
}
xyz600600