結果
問題 |
No.478 一般門松列列
|
ユーザー |
|
提出日時 | 2017-03-29 10:55:59 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 27 ms / 2,000 ms |
コード長 | 711 bytes |
コンパイル時間 | 493 ms |
コンパイル使用メモリ | 69,976 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-06 15:02:22 |
合計ジャッジ時間 | 2,246 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 34 |
ソースコード
#include <iostream> #include <vector> using namespace std; int n,k; int main(){ cin >> n >> k; vector<int> a(n,0); int num = 0; for(int i = 0; i < n; i++){ switch(i % 4){ case 0: num = 1; break; case 1: num = 3; break; case 2: num = 2; break; case 3: num = 4; break; } a[i] = num; } if(n-k-1<0){ cout << -1 << endl; return 0; } for(int i = n-k; i < n;i++){ a[i] = a[n-k-1]; } for(auto e : a){ cout << e << endl; } return 0; }