結果
問題 |
No.2870 Dice Making
|
ユーザー |
![]() |
提出日時 | 2024-09-28 15:05:22 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 602 bytes |
コンパイル時間 | 2,849 ms |
コンパイル使用メモリ | 244,404 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-09-28 15:05:29 |
合計ジャッジ時間 | 3,666 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 13 |
ソースコード
#include <bits/stdc++.h> using namespace std; using i64 = long long; using u64 = unsigned long long; using u32 = unsigned; void solve() { int n, k; cin >> n >> k; if (n % k) { cout << -1 << endl; } else { int num = n / k; for (int i = 0; i < num; i++) { cout << 1 << ' '; } int cnt = 2; for (int i = 0; i < n - num; i++) { cout << cnt++ << ' '; } cout << endl; } } signed main() { ios::sync_with_stdio(false); cin.tie(nullptr); solve(); return 0; }