結果

問題 No.2870 Dice Making
ユーザー Vicfred
提出日時 2025-04-21 15:31:17
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 402 bytes
コンパイル時間 851 ms
コンパイル使用メモリ 66,552 KB
実行使用メモリ 7,848 KB
最終ジャッジ日時 2025-04-21 15:31:20
合計ジャッジ時間 2,338 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

// vicfred
// https://yukicoder.me/problems/no/2870
// math
#include <cstdint>
#include <iostream>

using namespace std;

int main() {
  int64_t n, k;
  cin >> n >> k;
  if (n % k != 0) {
    cout << -1 << endl;
    return 0;
  }
  int64_t c = n / k;
  for (int i = 0; i < c; ++i) {
    cout << 1 << " ";
  }
  for(int i = c; i < n; ++i) {
    cout << 2 << "\n "[i == n - 1 ? 0 : 1];
  }
  return 0;
}
0