結果
問題 |
No.2870 Dice Making
|
ユーザー |
![]() |
提出日時 | 2024-09-28 15:09:17 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 355 bytes |
コンパイル時間 | 638 ms |
コンパイル使用メモリ | 66,156 KB |
最終ジャッジ日時 | 2025-02-24 13:56:25 |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 13 |
ソースコード
#include<iostream> using namespace std; int n, k; bool solve() { return n % k == 0; } int main() { cin >> n >> k; if (solve()) { int need = n / k; int cnt = 0; for (int i = 1; i <= n; ++i) { if (cnt != need) { cout << 1 << " "; cnt++; } else { cout << 2 << " "; } } } else { cout << -1 << endl; } return 0; }