結果

問題 No.491 10^9+1と回文
ユーザー snrnsidy
提出日時 2021-09-24 22:26:25
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 503 bytes
コンパイル時間 2,001 ms
コンパイル使用メモリ 194,028 KB
最終ジャッジ日時 2025-01-24 17:29:58
ジャッジサーバーID
(参考情報)
judge5 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 42 WA * 61
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

int main(void)
{
	cin.tie(0);
	ios::sync_with_stdio(false);

	long long int N;

	cin >> N;

	long long int cnt = 0;
	__int128 base = 0;
	for(int i=0;i<9;i++)
	{
		base += pow(10,i);
		//cout << i << ' ' << base << '\n';
		for(long long int j=1;j<10;j++)
		{
			__int128 val = base*j;
			val += (j*base*1000000000LL);
			if(val<=N) 
			{
				long long int temp = val;
				//cout << temp << '\n';
				cnt++;
			}
		} 
	}

	cout << cnt << '\n';

	return 0;
}
0