結果
問題 | No.313 π |
ユーザー |
![]() |
提出日時 | 2015-09-02 16:55:01 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 6 ms / 5,000 ms |
コード長 | 380 bytes |
コンパイル時間 | 394 ms |
コンパイル使用メモリ | 56,700 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-18 21:32:07 |
合計ジャッジ時間 | 1,515 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 32 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:17:29: warning: ‘y’ may be used uninitialized in this function [-Wmaybe-uninitialized] 17 | cout << x << ' ' << y << endl; | ^ main.cpp:17:22: warning: ‘x’ may be used uninitialized in this function [-Wmaybe-uninitialized] 17 | cout << x << ' ' << y << endl; | ^~~
ソースコード
#include <iostream>#include <string>using namespace std;int a[10] = {20104, 20063, 19892, 20011, 19874, 20199, 19898, 20163, 19956, 19841};int main() {string S; cin >> S;for (int i = 0; i < S.length(); i++)if (i != 1)a[S[i] - '0']--;int x, y;for (int k = 0; k < 10; k++) {if (a[k] == -1) x = k;if (a[k] == 1) y = k;}cout << x << ' ' << y << endl;}