提出 #58124277


ソースコード 拡げる

#include <bits/stdc++.h>
using namespace std;
using ll = long long;

#define rep(i, x) for (int i = 0; i < (x); i++)

int main()
{
  int M;
  cin >> M;
  vector<int> ans;
  for (int k = 0; k <= 10; ++k)
  {
    for (int i = 0; i < (M % 3); i++)
    {
      ans.push_back(k);
    }
    M /= 3;
  }

  cout << (int)ans.size() << endl;
  for (int i = 0; i < (int)ans.size(); i++)
  {
    if (i != 0)
    {
      cout << " ";
    }
    cout << ans[i];
  }
  cout << endl;

  return 0;
}

提出情報

提出日時
問題 B - 3^A
ユーザ ryoh1004
言語 C++ 23 (gcc 12.2)
得点 200
コード長 482 Byte
結果 AC
実行時間 1 ms
メモリ 3672 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 200 / 200
結果
AC × 3
AC × 51
セット名 テストケース
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
ケース名 結果 実行時間 メモリ
00_sample_100.txt AC 1 ms 3672 KiB
00_sample_59048.txt AC 1 ms 3596 KiB
00_sample_6.txt AC 1 ms 3552 KiB
01_small_1.txt AC 1 ms 3484 KiB
01_small_10.txt AC 1 ms 3636 KiB
01_small_11.txt AC 1 ms 3612 KiB
01_small_2.txt AC 1 ms 3448 KiB
01_small_3.txt AC 1 ms 3472 KiB
01_small_4.txt AC 1 ms 3484 KiB
01_small_5.txt AC 1 ms 3448 KiB
01_small_7.txt AC 1 ms 3532 KiB
01_small_8.txt AC 1 ms 3548 KiB
01_small_9.txt AC 1 ms 3532 KiB
02_large_39365.txt AC 1 ms 3492 KiB
02_large_52487.txt AC 1 ms 3492 KiB
02_large_56861.txt AC 1 ms 3496 KiB
02_large_58319.txt AC 1 ms 3492 KiB
02_large_58805.txt AC 1 ms 3552 KiB
02_large_58967.txt AC 1 ms 3492 KiB
02_large_59021.txt AC 1 ms 3540 KiB
02_large_59039.txt AC 1 ms 3640 KiB
02_large_59045.txt AC 1 ms 3544 KiB
02_large_98414.txt AC 1 ms 3536 KiB
03_handmade_100000.txt AC 1 ms 3420 KiB
03_handmade_78732.txt AC 1 ms 3448 KiB
03_handmade_98409.txt AC 1 ms 3556 KiB
03_handmade_98412.txt AC 1 ms 3476 KiB
03_handmade_98413.txt AC 1 ms 3552 KiB
03_handmade_98415.txt AC 1 ms 3672 KiB
03_handmade_99144.txt AC 1 ms 3472 KiB
03_handmade_99870.txt AC 1 ms 3492 KiB
03_handmade_99871.txt AC 1 ms 3492 KiB
03_handmade_99872.txt AC 1 ms 3492 KiB
03_handmade_99873.txt AC 1 ms 3492 KiB
03_handmade_99953.txt AC 1 ms 3536 KiB
03_handmade_99954.txt AC 1 ms 3472 KiB
03_handmade_99981.txt AC 1 ms 3476 KiB
03_handmade_99990.txt AC 1 ms 3544 KiB
03_handmade_99997.txt AC 1 ms 3608 KiB
03_handmade_99998.txt AC 1 ms 3476 KiB
03_handmade_99999.txt AC 1 ms 3540 KiB
04_random_11273.txt AC 1 ms 3488 KiB
04_random_16808.txt AC 1 ms 3488 KiB
04_random_27545.txt AC 1 ms 3476 KiB
04_random_37710.txt AC 1 ms 3628 KiB
04_random_43659.txt AC 1 ms 3484 KiB
04_random_50074.txt AC 1 ms 3548 KiB
04_random_50879.txt AC 1 ms 3628 KiB
04_random_75250.txt AC 1 ms 3536 KiB
04_random_77924.txt AC 1 ms 3476 KiB
04_random_8931.txt AC 1 ms 3536 KiB