結果
問題 | No.2870 Dice Making |
ユーザー |
![]() |
提出日時 | 2024-09-06 21:22:53 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 732 bytes |
コンパイル時間 | 2,112 ms |
コンパイル使用メモリ | 192,684 KB |
最終ジャッジ日時 | 2025-02-24 03:58:09 |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 13 |
ソースコード
#include <bits/stdc++.h> using namespace std; using ll = long long; #define ALL(v) v.begin(),v.end() #define dbg(x) cerr << #x << ": " << (x) << endl; template<class F, class S> ostream& operator<<(ostream& os, pair<F,S>& p) { os << '(' << p.first << ',' << p.second << ')'; return os; } template<class Iter> void print(Iter beg, Iter end) { for (Iter itr = beg; itr != end; ++itr) { cerr << *itr << ' '; } cerr << '\n'; } int n,k; int main() { cin >> n >> k; if (n % k == 0) { for (int i = 0; i < n/k; ++i) { cout << 1 << " "; } for (int i = n/k; i < n; ++i) { cout << 2 << " \n"[i==n-1]; } } else { cout << -1 << '\n'; } }