結果

問題 No.491 10^9+1と回文
ユーザー umaumax
提出日時 2017-05-08 21:04:21
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 321 bytes
コンパイル時間 474 ms
コンパイル使用メモリ 54,992 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-09-14 17:33:26
合計ジャッジ時間 3,079 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 32 WA * 71
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>

using namespace std;

int main(int argc, const char* argv[])
{
	uint64_t N;
	cin >> N;
	uint64_t b = (uint64_t)1e9 + 1;
	//	1~9
	//	11~99
	//	111~999
	//	...
	//	11111111~99999999
	int cnt = 0;
	N /= b;
	while (N > 0) {
		cnt += N >= 10 ? 9 : N % 10;
		N /= 10;
	}
	cout << cnt << endl;
	return 0;
}
0