結果
問題 | No.478 一般門松列列 |
ユーザー |
![]() |
提出日時 | 2017-01-27 22:37:11 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 4 ms / 2,000 ms |
コード長 | 339 bytes |
コンパイル時間 | 583 ms |
コンパイル使用メモリ | 68,636 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-23 16:22:29 |
合計ジャッジ時間 | 2,010 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 34 |
ソースコード
#include <iostream> #include <algorithm> #include <vector> using namespace std; int main(){ int n,k; cin>>n>>k; for(int i=0;i<k;i++)cout<<0<<' '; int d=1; for(int i=0;i<n-k;i++){ cout<<d<<' '; if(i%2==0){ d+=2; }else{ d--; } } cout<<endl; return 0; }