結果
| 問題 |
No.491 10^9+1と回文
|
| ユーザー |
SSRS
|
| 提出日時 | 2020-11-17 09:29:48 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 393 bytes |
| コンパイル時間 | 591 ms |
| コンパイル使用メモリ | 70,040 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-23 01:56:20 |
| 合計ジャッジ時間 | 3,133 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 93 WA * 10 |
ソースコード
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main(){
long long N;
cin >> N;
N /= 1000000001;
int ans = 0;
for (int i = 1; i < 10000; i++){
string S = to_string(i);
string T = S;
reverse(T.begin(), T.end());
string T2 = T.substr(1);
if (stoll(S + T) <= N){
ans++;
}
if (stoll(S + T2) <= N){
ans++;
}
}
cout << ans << endl;
}
SSRS