結果
問題 | No.478 一般門松列列 |
ユーザー |
|
提出日時 | 2018-05-24 09:54:19 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 4 ms / 2,000 ms |
コード長 | 355 bytes |
コンパイル時間 | 471 ms |
コンパイル使用メモリ | 63,232 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-28 16:43:31 |
合計ジャッジ時間 | 1,916 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 34 |
ソースコード
// coding on smartphone #include<iostream> using namespace std; int main(){ int n, k; cin >> n >> k; cout << 0 << " " << 2; int now = 2; bool flag = false; int i; for(i = 2; i < n-k; i++){ if(!flag) now--; else now+=2; cout << " " << now; flag = !flag; } for(; i < n; i++){ cout << " " << now; } cout << endl; return 0; }