結果

問題 No.491 10^9+1と回文
ユーザー rapurasu
提出日時 2017-03-10 23:01:59
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 576 bytes
コンパイル時間 1,203 ms
コンパイル使用メモリ 157,792 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-06-24 08:31:36
合計ジャッジ時間 3,555 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 27 WA * 76
権限があれば一括ダウンロードができます

ソースコード

diff #

#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 temp=N/1000000001;
        LL ans=temp%10;
       // cout<<temp<<endl;
        while(temp>10){
           temp/=10;
           ans+=9;
        }
        //ans+=temp;
        if(N<1000000001){
           cout<<0<<endl;
        }else{
           cout<<ans<<endl;
        }
	return(0);
}
0