結果
問題 | No.478 一般門松列列 |
ユーザー |
|
提出日時 | 2018-11-16 22:20:07 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 5 ms / 2,000 ms |
コード長 | 514 bytes |
コンパイル時間 | 785 ms |
コンパイル使用メモリ | 70,272 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-24 14:16:28 |
合計ジャッジ時間 | 2,337 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 34 |
ソースコード
#include <iostream> #include <vector> using namespace std; int main(int argc, char* argv[]) { vector<int> y; y.push_back(1); y.push_back(3); y.push_back(2); y.push_back(4); int N,K; cin>>N>>K; int i; vector<int> X; int j=0; for (i=0;i<N;i++){ X.push_back(y[j++]); if (j==4){ j=0; } } for (i=N-K;i<N;i++){ if (i<1){ cout<<-1<<endl; return 0; } X[i]=X[i-1]; } int Num=X.size(); for (i=0;i<Num;i++){ cout<<X[i]; if (i<Num-1){ cout<<" "; } } cout<<endl; return 0; }