結果
| 問題 |
No.491 10^9+1と回文
|
| ユーザー |
Yut176
|
| 提出日時 | 2017-06-10 17:50:04 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 587 bytes |
| コンパイル時間 | 768 ms |
| コンパイル使用メモリ | 83,572 KB |
| 実行使用メモリ | 13,756 KB |
| 最終ジャッジ日時 | 2024-09-24 15:43:59 |
| 合計ジャッジ時間 | 4,153 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 3 TLE * 1 -- * 99 |
ソースコード
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<vector>
#include<string>
#include<sstream>
#include<cmath>
#include<numeric>
#include<map>
#include<stack>
#include<queue>
using namespace std;
bool isCycle(string s){
for(int i=0; i<s.size(); i++){
if( s[i] != s[s.size()-1-i] ) return false;
}
return true;
}
int main(void) {
long long int n;
cin >> n;
long long int q = 1000000001;
long long int cnt = 0;
for(long long int i=1; i*q<n; i++){
cnt += isCycle(to_string(i));
}
cout << cnt << endl;
return 0;
}
// EOF
Yut176