Submission #21088851


Source Code Expand

#include <iostream>
#include <string>
#include <cmath>

using namespace std;

int main(){
    long long N;
    cin >> N;
    string S = to_string(N);
    if(S.length() % 2 == 1){
        cout << pow(10,S.length() / 2) - 1 << endl;
    }else{
        if(N % static_cast<long long>(pow(10,S.length() / 2)) >= N / static_cast<long long>(pow(10,S.length() / 2))){
            cout << static_cast<long long>(N / pow(10,S.length() / 2)) << endl;
        }else{
            cout << static_cast<long long>(N / pow(10,S.length() / 2)) - 1 << endl;
        }
    }
}

Submission Info

Submission Time
Task C - Doubled
User sikeking
Language C++ (Clang 10.0.0)
Score 300
Code Size 575 Byte
Status AC
Exec Time 12 ms
Memory 3604 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 3
AC × 34
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 12 ms 3188 KiB
02_sample.txt AC 2 ms 3300 KiB
03_sample.txt AC 2 ms 3560 KiB
04_hand.txt AC 2 ms 3536 KiB
05_hand.txt AC 2 ms 3588 KiB
06_hand.txt AC 2 ms 3404 KiB
07_hand.txt AC 2 ms 3576 KiB
08_hand.txt AC 2 ms 3392 KiB
09_hand.txt AC 2 ms 3332 KiB
10_random.txt AC 2 ms 3304 KiB
11_random.txt AC 2 ms 3132 KiB
12_random.txt AC 2 ms 3132 KiB
13_random.txt AC 2 ms 3536 KiB
14_random.txt AC 2 ms 3408 KiB
15_random.txt AC 2 ms 3080 KiB
16_random.txt AC 2 ms 3588 KiB
17_random.txt AC 2 ms 3472 KiB
18_random.txt AC 3 ms 3116 KiB
19_random.txt AC 2 ms 3548 KiB
20_random.txt AC 2 ms 3540 KiB
21_random.txt AC 2 ms 3404 KiB
22_random.txt AC 2 ms 3408 KiB
23_random.txt AC 2 ms 3152 KiB
24_random.txt AC 2 ms 3224 KiB
25_random.txt AC 2 ms 3556 KiB
26_random.txt AC 2 ms 3540 KiB
27_random.txt AC 2 ms 3452 KiB
28_random.txt AC 2 ms 3604 KiB
29_random.txt AC 2 ms 3504 KiB
30_double.txt AC 2 ms 3516 KiB
31_double.txt AC 2 ms 3484 KiB
32_double.txt AC 2 ms 3472 KiB
33_double.txt AC 3 ms 3576 KiB
34_double.txt AC 2 ms 3496 KiB