結果
問題 |
No.491 10^9+1と回文
|
ユーザー |
![]() |
提出日時 | 2017-03-10 23:17:24 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 887 bytes |
コンパイル時間 | 1,259 ms |
コンパイル使用メモリ | 158,748 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-06-24 08:39:39 |
合計ジャッジ時間 | 3,618 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 42 WA * 61 |
ソースコード
#include<bits/stdc++.h> using namespace std; #define FOR(i,a,b) for (int i=(a);i<(b);i++) #define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--) #define REP(i,n) for (int i=0;i<(n);i++) #define RREP(i,n) for (int i=(n)-1;i>=0;i--) typedef long long LL; LL N; int main(){ cin>>N; LL ans=0; REP(i,1<<9){ if(i==0)continue; LL temp=0; LL temp2=1000000001; LL x=i; bool check=false; while(x>0){ if(x%2==1){ temp+=temp2; }else{ check=true; break; } x/=2; temp2*=10; } if(check)continue; REP(j,9){ if(N>=temp*(j+1)){ ans++; } } } cout<<ans<<endl; return(0); }