結果

問題 No.313 π
ユーザー tancahn2380
提出日時 2017-09-16 05:36:46
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
RE  
実行時間 -
コード長 779 bytes
コンパイル時間 794 ms
コンパイル使用メモリ 84,268 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-08 00:41:00
合計ジャッジ時間 7,436 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample RE * 2
other RE * 32
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:26:38: warning: iteration 58 invokes undefined behavior [-Waggressive-loop-optimizations]
   26 |                 if (i != -1)a[i - '0']--;
      |                             ~~~~~~~~~^
main.cpp:25:27: note: within this loop
   25 |         for (int i = 0; i < 200010; i++) {
      |                         ~~^~~~~~~~

ソースコード

diff #

# include <iostream>
# include <algorithm>
# include <vector>
# include <string>
# include <set>
# include <map>
# include <cmath>
# include <iomanip>
# include <functional>
# include <utility>
# include <stack>
# include <queue>
# include <list>
using namespace std;
using LL = long long;
constexpr long long MOD = 1000000000 + 7;
constexpr long long INF = 1000000000;
const double PI = acos(-1);

int main() {
	int a[10] = { 20104,20063,19892,20011,19874,20199,19898,20163,19956,19841 };
	char s[200010];
	cin >> s;
	int ans;
	for (int i = 0; i < 200010; i++) {
		if (i != -1)a[i - '0']--;
	}
	for (int i = 0; i < 10; i++) {
		if (a[i] == -1) {
			cout << i << " " << i - 1 << endl;
			break;
		}
		else if (a[i] == 1) {
			cout << i << " " << i + 1 << endl;
			break;
		}
	}
}
0