Submission #57946771


Source Code Expand

#include <iostream>
#include <vector>
using namespace std;
int main() {
    int M;
    cin >> M;
    vector<int> A;
    for (int k = 0; k <= 10; k++) {
        for (int i = 0; i < (M % 3); i++) {
            A.push_back(k);
        }
        M /= 3;
    }
    cout << A.size() << endl;
    for (int i = 0; i < A.size(); i++) {
        cout << A[i] << " \n"[i == A.size() - 1];
    }
    return 0;
}

Submission Info

Submission Time
Task B - 3^A
User sounansya
Language C++ 23 (gcc 12.2)
Score 200
Code Size 416 Byte
Status AC
Exec Time 1 ms
Memory 3656 KiB

Compile Error

Main.cpp: In function ‘int main()’:
Main.cpp:15:23: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector<int>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]
   15 |     for (int i = 0; i < A.size(); i++) {
      |                     ~~^~~~~~~~~~
Main.cpp:16:33: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector<int>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]
   16 |         cout << A[i] << " \n"[i == A.size() - 1];
      |                               ~~^~~~~~~~~~~~~~~

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 3
AC × 51
Set Name Test Cases
Sample 00_sample_100.txt, 00_sample_59048.txt, 00_sample_6.txt
All 00_sample_100.txt, 00_sample_59048.txt, 00_sample_6.txt, 01_small_1.txt, 01_small_10.txt, 01_small_11.txt, 01_small_2.txt, 01_small_3.txt, 01_small_4.txt, 01_small_5.txt, 01_small_7.txt, 01_small_8.txt, 01_small_9.txt, 02_large_39365.txt, 02_large_52487.txt, 02_large_56861.txt, 02_large_58319.txt, 02_large_58805.txt, 02_large_58967.txt, 02_large_59021.txt, 02_large_59039.txt, 02_large_59045.txt, 02_large_98414.txt, 03_handmade_100000.txt, 03_handmade_78732.txt, 03_handmade_98409.txt, 03_handmade_98412.txt, 03_handmade_98413.txt, 03_handmade_98415.txt, 03_handmade_99144.txt, 03_handmade_99870.txt, 03_handmade_99871.txt, 03_handmade_99872.txt, 03_handmade_99873.txt, 03_handmade_99953.txt, 03_handmade_99954.txt, 03_handmade_99981.txt, 03_handmade_99990.txt, 03_handmade_99997.txt, 03_handmade_99998.txt, 03_handmade_99999.txt, 04_random_11273.txt, 04_random_16808.txt, 04_random_27545.txt, 04_random_37710.txt, 04_random_43659.txt, 04_random_50074.txt, 04_random_50879.txt, 04_random_75250.txt, 04_random_77924.txt, 04_random_8931.txt
Case Name Status Exec Time Memory
00_sample_100.txt AC 1 ms 3496 KiB
00_sample_59048.txt AC 1 ms 3468 KiB
00_sample_6.txt AC 1 ms 3596 KiB
01_small_1.txt AC 1 ms 3492 KiB
01_small_10.txt AC 1 ms 3448 KiB
01_small_11.txt AC 1 ms 3468 KiB
01_small_2.txt AC 1 ms 3528 KiB
01_small_3.txt AC 1 ms 3460 KiB
01_small_4.txt AC 1 ms 3464 KiB
01_small_5.txt AC 1 ms 3452 KiB
01_small_7.txt AC 1 ms 3460 KiB
01_small_8.txt AC 1 ms 3460 KiB
01_small_9.txt AC 1 ms 3564 KiB
02_large_39365.txt AC 1 ms 3504 KiB
02_large_52487.txt AC 1 ms 3548 KiB
02_large_56861.txt AC 1 ms 3384 KiB
02_large_58319.txt AC 1 ms 3464 KiB
02_large_58805.txt AC 1 ms 3448 KiB
02_large_58967.txt AC 1 ms 3448 KiB
02_large_59021.txt AC 1 ms 3500 KiB
02_large_59039.txt AC 1 ms 3464 KiB
02_large_59045.txt AC 1 ms 3464 KiB
02_large_98414.txt AC 1 ms 3460 KiB
03_handmade_100000.txt AC 1 ms 3624 KiB
03_handmade_78732.txt AC 1 ms 3492 KiB
03_handmade_98409.txt AC 1 ms 3504 KiB
03_handmade_98412.txt AC 1 ms 3464 KiB
03_handmade_98413.txt AC 1 ms 3504 KiB
03_handmade_98415.txt AC 1 ms 3588 KiB
03_handmade_99144.txt AC 1 ms 3448 KiB
03_handmade_99870.txt AC 1 ms 3472 KiB
03_handmade_99871.txt AC 1 ms 3504 KiB
03_handmade_99872.txt AC 1 ms 3444 KiB
03_handmade_99873.txt AC 1 ms 3448 KiB
03_handmade_99953.txt AC 1 ms 3456 KiB
03_handmade_99954.txt AC 1 ms 3496 KiB
03_handmade_99981.txt AC 1 ms 3528 KiB
03_handmade_99990.txt AC 1 ms 3496 KiB
03_handmade_99997.txt AC 1 ms 3588 KiB
03_handmade_99998.txt AC 1 ms 3504 KiB
03_handmade_99999.txt AC 1 ms 3356 KiB
04_random_11273.txt AC 1 ms 3656 KiB
04_random_16808.txt AC 1 ms 3456 KiB
04_random_27545.txt AC 1 ms 3464 KiB
04_random_37710.txt AC 1 ms 3468 KiB
04_random_43659.txt AC 1 ms 3468 KiB
04_random_50074.txt AC 1 ms 3448 KiB
04_random_50879.txt AC 1 ms 3656 KiB
04_random_75250.txt AC 1 ms 3448 KiB
04_random_77924.txt AC 1 ms 3468 KiB
04_random_8931.txt AC 1 ms 3444 KiB