結果
問題 | No.491 10^9+1と回文 |
ユーザー |
![]() |
提出日時 | 2017-03-10 22:38:50 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,114 bytes |
コンパイル時間 | 1,499 ms |
コンパイル使用メモリ | 167,536 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-06-24 07:58:02 |
合計ジャッジ時間 | 3,783 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 32 WA * 71 |
ソースコード
#include <bits/stdc++.h>#ifndef LOCAL_#define fprintf if( false ) fprintf#endif // LOCAL_#define dumpi(x1) fprintf(stderr, "#%s.%d (%s) = (%d)\n", __func__, __LINE__, #x1, x1);#define dumpii(x1, x2) fprintf(stderr, "#%s.%d (%s, %s) = (%d, %d)\n", __func__, __LINE__, #x1, #x2, x1, x2);#define dumpiii(x1, x2, x3) fprintf(stderr, "#%s.%d (%s, %s, %s) = (%d, %d, %d)\n", __func__, __LINE__, #x1, #x2, #x3, x1, x2, x3);#define dumpl(x1) fprintf(stderr, "#%s.%d (%s) = (%ld)\n", __func__, __LINE__, #x1, x1);#define dumpll(x1, x2) fprintf(stderr, "#%s.%d (%s, %s) = (%ld, %ld)\n", __func__, __LINE__, #x1, #x2, x1, x2);#define dumpd(x1) fprintf(stderr, "#%s.%d (%s) = (%lf)\n", __func__, __LINE__, #x1, x1);#define dumpdd(x1, x2) fprintf(stderr, "#%s.%d (%s, %s) = (%lf, %lf)\n", __func__, __LINE__, #x1, #x2, x1, x2);int main() {std::string str;std::cin >> str;long t = std::stol(str);long low = t % 1000000000;long high = t / 1000000000;int res = t < 1000000001 ? 0 : ((int)str.size() - 10) * 9 + (high > low ? str[0] - '0' - 1 : str[0] - '0');printf("%d\n", res);return 0;}