結果
問題 | No.478 一般門松列列 |
ユーザー |
![]() |
提出日時 | 2018-01-07 15:48:57 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 30 ms / 2,000 ms |
コード長 | 587 bytes |
コンパイル時間 | 635 ms |
コンパイル使用メモリ | 73,976 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-23 09:59:09 |
合計ジャッジ時間 | 2,557 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 34 |
ソースコード
#include <iostream> #include <iomanip> #include <vector> #include <algorithm> #include <string> #include <sstream> #include <cmath> #include <stack> #include <cctype> #include <stdio.h> using namespace std; int a[22000]; int main() { int n=0,k=0; cin>>n>>k; if(n-k-2 !=0){ a[0] =1; a[1] =3; a[2] =2; }else { for(int i=0; i<n; i++){ cout<<a[i]<<endl; } return 0; } int i; for( i=1; i<n;i++){ a[i+2] = a[i]+1; } for(int j=0; j<k; j++){ a[j] = a[k]; /* cout<<a[n-2];*/ } for(int i=0; i<n; i++){ cout<<a[i]<<endl; } return 0; }