結果
問題 | No.478 一般門松列列 |
ユーザー |
|
提出日時 | 2018-09-29 13:54:32 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 4 ms / 2,000 ms |
コード長 | 522 bytes |
コンパイル時間 | 472 ms |
コンパイル使用メモリ | 62,720 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-12 08:14:46 |
合計ジャッジ時間 | 2,041 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 34 |
ソースコード
#include <iostream>using namespace std;int main() {int n, k, min = 0, max = 1000000000, tmp = 1;cin >> n >> k;for (int i = 0; i < n; ++i) {if (k > i) {cout << min;++min;}else {if (tmp) {cout << min;++min;}else {cout << max;--max;}tmp ^= 1;}if (i != n - 1) cout << " ";}}