結果
問題 | No.313 π |
ユーザー |
![]() |
提出日時 | 2019-03-16 10:38:38 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 5,000 ms |
コード長 | 635 bytes |
コンパイル時間 | 731 ms |
コンパイル使用メモリ | 73,964 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-01 22:22:36 |
合計ジャッジ時間 | 1,762 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 32 |
コンパイルメッセージ
main.cpp: In function 'int main()': main.cpp:29:26: warning: 'i1' may be used uninitialized [-Wmaybe-uninitialized] 29 | cout << i0 << ' ' << i1 << endl; | ^~ main.cpp:24:13: note: 'i1' was declared here 24 | int i0, i1; | ^~ main.cpp:29:19: warning: 'i0' may be used uninitialized [-Wmaybe-uninitialized] 29 | cout << i0 << ' ' << i1 << endl; | ^~~ main.cpp:24:9: note: 'i0' was declared here 24 | int i0, i1; | ^~
ソースコード
#include <iostream> #include <vector> #include <string> #include <algorithm> #include <cstdio> #include <cstring> #include <cmath> using namespace std; using ll = long long; int main() { ios::sync_with_stdio(false); cin.tie(0); string s; cin >> s; int p[10] = { 20104, 20063, 19892, 20010, 19874, 20199, 19898, 20163, 19956, 19841, }; p[3]++; p[s[0] - '0']--; for (int i = 0; i < 200000; i++) { p[s[i + 2] - '0']--; } int i0, i1; for (int i = 0; i < 10; i++) { if (p[i] < 0) i0 = i; if (p[i] > 0) i1 = i; } cout << i0 << ' ' << i1 << endl; return 0; }