結果

問題 No.491 10^9+1と回文
ユーザー olpheolphe
提出日時 2017-03-10 22:39:11
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
TLE  
実行時間 -
コード長 670 bytes
コンパイル時間 912 ms
コンパイル使用メモリ 110,280 KB
実行使用メモリ 13,752 KB
最終ジャッジ日時 2024-06-24 07:58:09
合計ジャッジ時間 3,377 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 2 TLE * 2 -- * 99
権限があれば一括ダウンロードができます

ソースコード

diff #

#include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "math.h"
#include "utility"
#include "string"
#include "map"
#include "unordered_map"
#include "iomanip"
#include "random"

using namespace std;
const long long int MOD = 1000000007;

long long int N;
string a;
string b;
int ans;
int box;

int main() {
	cin >> N;
	N /= 1000000001;
	for (int i = 1; i <= N; i++) {
		box = i;
		while (box) {
			a.push_back(char(box % 10));
			b.insert(begin(b), char(box % 10));
			box /= 10;
		}
		if (a == b)ans++;
		a.clear();
		b.clear();
	}
	cout << ans << endl;
	return 0;
}
0