結果
問題 |
No.491 10^9+1と回文
|
ユーザー |
![]() |
提出日時 | 2017-03-10 22:32:19 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 860 bytes |
コンパイル時間 | 787 ms |
コンパイル使用メモリ | 93,684 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-06-24 07:57:06 |
合計ジャッジ時間 | 3,306 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 29 WA * 74 |
ソースコード
#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <algorithm> #include <utility> #include <functional> #include <cstring> #include <queue> #include <stack> #include <math.h> #include <iterator> #include <vector> #include <string> #include <set> #include <math.h> #include <iostream> #include<map> #include <iomanip> #include <time.h> #include <random> #include <stdlib.h> #include <list> #include <typeinfo> #include <list> #include <set> using namespace std; #define MAX_MOD 1000000007 #define REP(i,n) for(long long i = 0;i < n;++i) int main() { string s; cin >> s; //-10 long long ans = max(((int)s.length()-10)*9,0); if (s.length() >= 10) { ans += s[0] - '1'; for (int i = 0;i < s.length() - 9;++i) { if (s[i] < s[0]) goto foo; if (s[s.length() - i - 1] < s[0]) goto foo; } ans++; foo:; } cout << ans << endl; return 0; }