結果
| 問題 |
No.2870 Dice Making
|
| コンテスト | |
| ユーザー |
Raihanul Islam
|
| 提出日時 | 2024-09-06 22:56:29 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 647 bytes |
| コンパイル時間 | 661 ms |
| コンパイル使用メモリ | 69,252 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-09-06 22:56:44 |
| 合計ジャッジ時間 | 2,193 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | AC * 8 WA * 5 |
ソースコード
#include <iostream>
#include <vector>
using namespace std;
int main()
{
int N, K;
cin >> N >> K;
// Case where it's impossible to construct such a dice
if (K > N)
{
cout << "-1" << endl;
return 0;
}
// Construct the dice configuration
vector<int> result(N);
for (int i = 0; i < K; ++i)
{
result[i] = i + 1; // Assign unique values from 1 to K
}
for (int i = K; i < N; ++i)
{
result[i] = 1; // Fill the rest with 1
}
// Output the result
for (int i = 0; i < N; ++i)
{
cout << result[i] << " ";
}
cout << endl;
return 0;
}
Raihanul Islam