結果
問題 |
No.491 10^9+1と回文
|
ユーザー |
![]() |
提出日時 | 2017-05-01 22:53:42 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 673 bytes |
コンパイル時間 | 1,605 ms |
コンパイル使用メモリ | 167,504 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-14 02:17:56 |
合計ジャッジ時間 | 9,681 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge6 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 1 |
other | AC * 25 WA * 31 RE * 47 |
ソースコード
#include<bits/stdc++.h> using namespace std; typedef long long ll; #define loop(i,a,b) for(i=a;i<b;i++) #define rloop(i,a,b) for(i=a;i>=b;i--) #define vi vector<int> #define vl vector<ll> #define vii vector< vector<int> > #define vll vector< vector<ll> > #define vs vector<string> const int inf=1000000001; const ll INF=1e16; #define MOD 1000000007 #define mod 1000000009 #define pi 3.14159265358979323846 int main(){ ll n; int i,j; cin>>n; ll k=n/inf; ll ans=0; string s; ll a; loop(i,0,k){ a=i*inf; s=to_string(a); bool flag=true; loop(j,0,s.size()){ if(s[j]!=s[s.size()-1-j]){ flag=false; } } if(flag){ ans++; } } cout<<ans<<endl; }