Submission #33258214


Source Code Expand

#include <bits/stdc++.h>

int main() {
    int n;
    std::cin >> n;
    std::cout << n * 2 << '\n';
    std::string str;
    while (n > 0) {
        int x = std::min(n, 4);
        str += (x + '0');
        n -= x;
    }
    std::reverse(str.begin(), str.end());
    std::cout << str;
    return 0;
}

Submission Info

Submission Time
Task A - Digit Sum of 2x
User siyuan
Language C++ (GCC 9.2.1)
Score 300
Code Size 316 Byte
Status AC
Exec Time 7 ms
Memory 3616 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 3
AC × 28
Set Name Test Cases
Sample 01_sample_01.txt, 01_sample_02.txt, 01_sample_03.txt
All 01_sample_01.txt, 01_sample_02.txt, 01_sample_03.txt, 02_small_01.txt, 02_small_02.txt, 02_small_03.txt, 02_small_04.txt, 02_small_05.txt, 02_small_06.txt, 02_small_07.txt, 02_small_08.txt, 02_small_09.txt, 02_small_10.txt, 02_small_11.txt, 02_small_12.txt, 02_small_13.txt, 02_small_14.txt, 02_small_15.txt, 03_rand_01.txt, 03_rand_02.txt, 03_rand_03.txt, 03_rand_04.txt, 03_rand_05.txt, 04_max_01.txt, 04_max_02.txt, 04_max_03.txt, 04_max_04.txt, 04_max_05.txt
Case Name Status Exec Time Memory
01_sample_01.txt AC 7 ms 3556 KiB
01_sample_02.txt AC 3 ms 3476 KiB
01_sample_03.txt AC 4 ms 3464 KiB
02_small_01.txt AC 2 ms 3452 KiB
02_small_02.txt AC 2 ms 3480 KiB
02_small_03.txt AC 2 ms 3616 KiB
02_small_04.txt AC 2 ms 3400 KiB
02_small_05.txt AC 2 ms 3580 KiB
02_small_06.txt AC 2 ms 3400 KiB
02_small_07.txt AC 2 ms 3500 KiB
02_small_08.txt AC 2 ms 3616 KiB
02_small_09.txt AC 2 ms 3400 KiB
02_small_10.txt AC 2 ms 3576 KiB
02_small_11.txt AC 3 ms 3552 KiB
02_small_12.txt AC 2 ms 3576 KiB
02_small_13.txt AC 2 ms 3580 KiB
02_small_14.txt AC 3 ms 3556 KiB
02_small_15.txt AC 2 ms 3584 KiB
03_rand_01.txt AC 2 ms 3520 KiB
03_rand_02.txt AC 3 ms 3488 KiB
03_rand_03.txt AC 2 ms 3556 KiB
03_rand_04.txt AC 2 ms 3472 KiB
03_rand_05.txt AC 2 ms 3572 KiB
04_max_01.txt AC 2 ms 3600 KiB
04_max_02.txt AC 2 ms 3480 KiB
04_max_03.txt AC 3 ms 3576 KiB
04_max_04.txt AC 3 ms 3540 KiB
04_max_05.txt AC 2 ms 3580 KiB