Submission #21093999
Source Code Expand
#include <bits/stdc++.h>
#include <atcoder/all>
#include <boost/multiprecision/cpp_int.hpp>
using namespace std;
using namespace atcoder;
namespace mp = boost::multiprecision;
#define REP(i, m, n) for (int i = (int) (m); i < (int) (n); ++i)
#define rep(i, n) REP(i, 0, n)
using ll = long long;
#define pint pair<int, int>
#define pll pair<ll, ll>
const int inf = 1e9 + 7;
const ll longinf = 1LL << 60;
const ll mod = 1e9 + 7;
using Bint = mp::cpp_int;
using mint = modint998244353;
int main() {
ll n;
cin >> n;
ll ans = 0;
ll i = 1;
while (1) {
ll j = i;
ll d = 1;
ll temp = j;
while (temp) {
d *= 10;
temp/= 10;
}
j += d * j;
if (j > n) {
break;
}
ans++;
i++;
}
cout << ans << endl;
return 0;
}
Submission Info
| Submission Time | |
|---|---|
| Task | C - Doubled |
| User | hnakashima |
| Language | C++ (GCC 9.2.1) |
| Score | 300 |
| Code Size | 780 Byte |
| Status | AC |
| Exec Time | 11 ms |
| Memory | 3624 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 300 / 300 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | 01_sample.txt, 02_sample.txt, 03_sample.txt |
| All | 01_sample.txt, 02_sample.txt, 03_sample.txt, 04_hand.txt, 05_hand.txt, 06_hand.txt, 07_hand.txt, 08_hand.txt, 09_hand.txt, 10_random.txt, 11_random.txt, 12_random.txt, 13_random.txt, 14_random.txt, 15_random.txt, 16_random.txt, 17_random.txt, 18_random.txt, 19_random.txt, 20_random.txt, 21_random.txt, 22_random.txt, 23_random.txt, 24_random.txt, 25_random.txt, 26_random.txt, 27_random.txt, 28_random.txt, 29_random.txt, 30_double.txt, 31_double.txt, 32_double.txt, 33_double.txt, 34_double.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 01_sample.txt | AC | 6 ms | 3492 KiB |
| 02_sample.txt | AC | 2 ms | 3548 KiB |
| 03_sample.txt | AC | 2 ms | 3532 KiB |
| 04_hand.txt | AC | 11 ms | 3496 KiB |
| 05_hand.txt | AC | 11 ms | 3596 KiB |
| 06_hand.txt | AC | 3 ms | 3620 KiB |
| 07_hand.txt | AC | 2 ms | 3468 KiB |
| 08_hand.txt | AC | 2 ms | 3624 KiB |
| 09_hand.txt | AC | 2 ms | 3588 KiB |
| 10_random.txt | AC | 2 ms | 3604 KiB |
| 11_random.txt | AC | 3 ms | 3528 KiB |
| 12_random.txt | AC | 2 ms | 3544 KiB |
| 13_random.txt | AC | 4 ms | 3600 KiB |
| 14_random.txt | AC | 2 ms | 3404 KiB |
| 15_random.txt | AC | 2 ms | 3468 KiB |
| 16_random.txt | AC | 1 ms | 3476 KiB |
| 17_random.txt | AC | 2 ms | 3468 KiB |
| 18_random.txt | AC | 3 ms | 3592 KiB |
| 19_random.txt | AC | 2 ms | 3420 KiB |
| 20_random.txt | AC | 2 ms | 3588 KiB |
| 21_random.txt | AC | 2 ms | 3516 KiB |
| 22_random.txt | AC | 5 ms | 3492 KiB |
| 23_random.txt | AC | 2 ms | 3492 KiB |
| 24_random.txt | AC | 2 ms | 3624 KiB |
| 25_random.txt | AC | 2 ms | 3476 KiB |
| 26_random.txt | AC | 3 ms | 3544 KiB |
| 27_random.txt | AC | 2 ms | 3496 KiB |
| 28_random.txt | AC | 2 ms | 3548 KiB |
| 29_random.txt | AC | 2 ms | 3528 KiB |
| 30_double.txt | AC | 2 ms | 3468 KiB |
| 31_double.txt | AC | 2 ms | 3416 KiB |
| 32_double.txt | AC | 5 ms | 3600 KiB |
| 33_double.txt | AC | 3 ms | 3548 KiB |
| 34_double.txt | AC | 3 ms | 3432 KiB |