結果
| 問題 |
No.491 10^9+1と回文
|
| コンテスト | |
| ユーザー |
vjudge1
|
| 提出日時 | 2025-05-16 15:45:08 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 482 bytes |
| コンパイル時間 | 1,422 ms |
| コンパイル使用メモリ | 162,452 KB |
| 実行使用メモリ | 7,848 KB |
| 最終ジャッジ日時 | 2025-05-16 15:45:12 |
| 合計ジャッジ時間 | 4,537 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 13 WA * 90 |
ソースコード
#include<bits/stdc++.h>
#define int long long
#define fr first
#define sc second
using namespace std;
int const N=1e6+5;
typedef pair<int,int> pii;
int n,m,sum,cnt,t,ans;
signed main()
{
// freopen(".in","r",stdin);
// freopen(".out","w",stdout);
ios::sync_with_stdio(0);
cin.tie(0),cout.tie(0);
string s;
cin>>s;
int n=s.size();
int p=(s[0]-'0');
int w=s[n-1]-'0';
n-=10;
ans+=n*9;
ans+=p;
if(w<p) ans--;
cout<<ans<<'\n';
return 0;
}
vjudge1