結果
問題 |
No.2870 Dice Making
|
ユーザー |
![]() |
提出日時 | 2024-09-28 15:10:19 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 555 bytes |
コンパイル時間 | 650 ms |
コンパイル使用メモリ | 67,920 KB |
最終ジャッジ日時 | 2025-02-24 13:56:29 |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 13 |
ソースコード
#include <iostream> using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(nullptr); cout.tie(nullptr); int N,K; cin >> N >> K; double n = 1.0*N/K; double n_check = (int)(N/K); if(n!=n_check) { cout << -1 << endl; return 0; } if(N==1&&K!=1) { cout << -1 << endl; return 0; } for(int i=1;i<=N;i++) { if(i<=n) { cout << 1 << " "; }else { cout << 2 << " "; } } return 0; }