結果
| 問題 | No.491 10^9+1と回文 |
| コンテスト | |
| ユーザー |
kotamanegi
|
| 提出日時 | 2017-03-10 22:32:19 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 860 bytes |
| 記録 | |
| コンパイル時間 | 572 ms |
| コンパイル使用メモリ | 114,684 KB |
| 実行使用メモリ | 7,848 KB |
| 最終ジャッジ日時 | 2026-03-10 07:37:49 |
| 合計ジャッジ時間 | 2,613 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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;
}
kotamanegi