結果

問題 No.491 10^9+1と回文
ユーザー fiord
提出日時 2017-03-10 23:24:51
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 335 bytes
コンパイル時間 623 ms
コンパイル使用メモリ 67,468 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-06-24 08:44:45
合計ジャッジ時間 3,225 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 42 WA * 61
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>
using namespace std;
typedef long long ll;
int main() {
	ll n;	cin >> n;
	ll base = 1e9 + 1;
	ll cnt = 0;
	ll multi = 1;
	ll num = 1;
	ll m = base;
	while (n >= m) {
		cnt++;
		num++;
		if (num == 10) {
			multi = multi * 10 + 1;
			num = 1;
		}
		m = base*num*multi;
	}
	cout << cnt << endl;
}
0