結果

問題 No.478 一般門松列列
ユーザー uenokuuenoku
提出日時 2017-01-27 23:59:38
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 986 bytes
コンパイル時間 840 ms
コンパイル使用メモリ 81,280 KB
実行使用メモリ 4,388 KB
最終ジャッジ日時 2023-08-25 11:11:25
合計ジャッジ時間 4,763 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 WA -
testcase_04 AC 2 ms
4,380 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 2 ms
4,376 KB
testcase_13 AC 2 ms
4,376 KB
testcase_14 WA -
testcase_15 AC 2 ms
4,380 KB
testcase_16 WA -
testcase_17 AC 2 ms
4,380 KB
testcase_18 AC 1 ms
4,380 KB
testcase_19 WA -
testcase_20 AC 1 ms
4,376 KB
testcase_21 AC 2 ms
4,380 KB
testcase_22 WA -
testcase_23 AC 2 ms
4,384 KB
testcase_24 WA -
testcase_25 AC 2 ms
4,376 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 1 ms
4,380 KB
testcase_29 AC 2 ms
4,380 KB
testcase_30 AC 2 ms
4,376 KB
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <algorithm>
#include <cmath>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rrep(i, n) for (int i = (n)-1; i >= 0; i--)
using namespace std;
typedef long long int lli;
lli MOD = 1000000007;
int main()

{
    int n, k;
    cin >> n >> k;
    int l = n - k - 2;
    int cnt = 0;
    int sum = 0;
    string s = "";
    if (l > 2) {
        l -= 2;
        s += "0 2 1 3 ";
        cnt += 4;
        while (l - 4 >= 0) {
            s += "0 2 1 3 ";
            l -= 4;
            cnt += 4;
        }
    }
    if (l == 1) {
        s += "0 ";
        cnt += 1;
    }
    if (l == 2) {
        s += "0 2 ";
        cnt += 2;
    }
    if (l == 2) {
        s += "0 2 1 ";
        cnt += 3;
    }
    if (cnt > n) {
        cout << -1 << endl;
        return 0;
    }
    string g = "";
    rep(i, n - cnt)
    {
        g += "0 ";
    }

    cout << g + s << endl;
}
0