結果

問題 No.2870 Dice Making
ユーザー Kiran Kumar
提出日時 2024-09-06 21:53:20
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 428 bytes
コンパイル時間 3,683 ms
コンパイル使用メモリ 272,080 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-09-06 21:53:49
合計ジャッジ時間 5,221 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 2
other AC * 6 WA * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main() {
    int n = 6, k = 5;
    // cin >> n >> k;

    if (k > n || n % k != 0) {
        cout << "-1\n";
        return 0;
    }
    int ones = n / k;

    for (int i = 0; i < n; i++) {
        if (ones) {
            cout << 1 << ' ';
            ones--;
            continue;
        } else {
            cout << i - ones << ' ';
        }
    }
}
0