結果
問題 |
No.2870 Dice Making
|
ユーザー |
![]() |
提出日時 | 2024-09-28 15:07:23 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 341 bytes |
コンパイル時間 | 1,281 ms |
コンパイル使用メモリ | 158,736 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-09-28 15:07:39 |
合計ジャッジ時間 | 2,350 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 13 |
ソースコード
#include<bits/stdc++.h> using namespace std; using ll=long long; void solve() { int n,k;cin>>n>>k; if(n%k||k>n) cout<<"-1"; else { int a=n/k; for(int i=1;i<=a;++i) cout<<"1 "; for(int i=a+1;i<=n;++i) cout<<i<<" "; } } int main() { ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); int _;_=1; while(_--) solve(); return 0; }