結果

問題 No.491 10^9+1と回文
ユーザー ふっぴーふっぴー
提出日時 2017-05-01 22:53:42
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 673 bytes
コンパイル時間 1,821 ms
コンパイル使用メモリ 166,904 KB
実行使用メモリ 4,500 KB
最終ジャッジ日時 2023-10-12 02:30:33
合計ジャッジ時間 12,639 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,368 KB
testcase_01 WA -
testcase_02 AC 2 ms
4,368 KB
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 WA -
testcase_09 AC 2 ms
4,372 KB
testcase_10 AC 2 ms
4,368 KB
testcase_11 WA -
testcase_12 RE -
testcase_13 AC 2 ms
4,368 KB
testcase_14 RE -
testcase_15 RE -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 RE -
testcase_20 WA -
testcase_21 RE -
testcase_22 AC 1 ms
4,372 KB
testcase_23 RE -
testcase_24 AC 1 ms
4,372 KB
testcase_25 WA -
testcase_26 AC 2 ms
4,372 KB
testcase_27 AC 1 ms
4,372 KB
testcase_28 WA -
testcase_29 AC 2 ms
4,368 KB
testcase_30 RE -
testcase_31 AC 2 ms
4,368 KB
testcase_32 RE -
testcase_33 AC 2 ms
4,368 KB
testcase_34 RE -
testcase_35 RE -
testcase_36 AC 1 ms
4,372 KB
testcase_37 WA -
testcase_38 WA -
testcase_39 RE -
testcase_40 AC 2 ms
4,368 KB
testcase_41 RE -
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
testcase_46 RE -
testcase_47 WA -
testcase_48 WA -
testcase_49 AC 1 ms
4,368 KB
testcase_50 RE -
testcase_51 RE -
testcase_52 WA -
testcase_53 AC 2 ms
4,372 KB
testcase_54 WA -
testcase_55 WA -
testcase_56 WA -
testcase_57 RE -
testcase_58 RE -
testcase_59 RE -
testcase_60 WA -
testcase_61 AC 1 ms
4,368 KB
testcase_62 RE -
testcase_63 RE -
testcase_64 WA -
testcase_65 AC 2 ms
4,368 KB
testcase_66 WA -
testcase_67 RE -
testcase_68 WA -
testcase_69 AC 2 ms
4,372 KB
testcase_70 WA -
testcase_71 RE -
testcase_72 RE -
testcase_73 RE -
testcase_74 WA -
testcase_75 AC 1 ms
4,372 KB
testcase_76 WA -
testcase_77 WA -
testcase_78 RE -
testcase_79 RE -
testcase_80 AC 2 ms
4,368 KB
testcase_81 AC 2 ms
4,368 KB
testcase_82 WA -
testcase_83 RE -
testcase_84 AC 2 ms
4,372 KB
testcase_85 RE -
testcase_86 AC 1 ms
4,368 KB
testcase_87 WA -
testcase_88 AC 1 ms
4,368 KB
testcase_89 RE -
testcase_90 RE -
testcase_91 RE -
testcase_92 AC 2 ms
4,372 KB
testcase_93 RE -
testcase_94 RE -
testcase_95 AC 2 ms
4,372 KB
testcase_96 WA -
testcase_97 RE -
testcase_98 RE -
testcase_99 RE -
testcase_100 RE -
testcase_101 RE -
testcase_102 RE -
testcase_103 RE -
testcase_104 RE -
testcase_105 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
}
0