結果
問題 | No.2870 Dice Making |
ユーザー |
![]() |
提出日時 | 2024-09-06 21:24:55 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 591 bytes |
コンパイル時間 | 2,106 ms |
コンパイル使用メモリ | 194,624 KB |
最終ジャッジ日時 | 2025-02-24 03:59:45 |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 13 |
ソースコード
#include<bits/stdc++.h>using namespace std;#define pb emplace_back#define mp make_pairusing ll = long long;using pii = pair<int,int>;constexpr int mod = 998244353;constexpr int inf = 0x3f3f3f3f;constexpr int N = 2e5 + 10;void _main(){int n, k;cin >> n >> k;if(n % k == 0){vector<int> a(n);for(int i=0; i<n/k; ++i) a[i] = 1;for(int i=n/k; i<n; ++i) a[i] = 2;for(int i=0; i<n; ++i) cout << a[i] << " \n"[i == n - 1];} else {cout << "-1\n";}}int main(){ios::sync_with_stdio(0);cin.tie(0); cout.tie(0);_main();return 0;}