結果
問題 | No.313 π |
ユーザー |
![]() |
提出日時 | 2016-09-04 22:35:23 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 5 ms / 5,000 ms |
コード長 | 673 bytes |
コンパイル時間 | 472 ms |
コンパイル使用メモリ | 54,764 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-11-15 20:16:51 |
合計ジャッジ時間 | 1,737 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 32 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:36:24: warning: ‘err’ may be used uninitialized in this function [-Wmaybe-uninitialized] 36 | cout << err << " " << cor << endl; | ^~~ main.cpp:36:31: warning: ‘cor’ may be used uninitialized in this function [-Wmaybe-uninitialized] 36 | cout << err << " " << cor << endl; | ^~~
ソースコード
#include <iostream>using namespace std;/* 0 = 201041 = 200632 = 198923 = 200114 = 198745 = 201996 = 198987 = 201638 = 199569 = 19841*/int main() {cin.tie(0); ios::sync_with_stdio(false);int num[10] = { 20104,20063,19892,20011,19874,20199,19898,20163,19956,19841 };int count_num[10] = { 0 };int cor, err;char c;for (int i = 0; i < 200002; i++) {cin >> c;if (c == '.') { continue; }count_num[c - '0']++;}for (int i = 0; i < 10; i++) {if (num[i] == count_num[i]) { continue; }else if (num[i] < count_num[i]) {err = i;}else {cor = i;}}cout << err << " " << cor << endl;return 0;}