結果

問題 No.1619 Coccinellidae
ユーザー yumaruyumaru
提出日時 2021-07-23 02:14:59
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,397 bytes
コンパイル時間 2,200 ms
コンパイル使用メモリ 208,608 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-24 23:15:14
合計ジャッジ時間 4,726 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
#define rep(i,a,b) for (int i = a; i < b; i++)
#define rrep(i,a,b) for (int i = a - 1; i >= b; i--)
#define rng(a) a.begin(), a.end()
#define rrng(a) a.rbegin(), a.rend()
#define eb emplace_back
#define pb push_back
#define fi first
#define se second
#define pvec(a) for (int i = 0; i < a.size(); i++) cout << a[i] << " "; cout << '\n'
#define dbwt(a) cout << fixed << setprecision(15) << a << '\n'
using namespace std;
using ll = long long;
void wt() {cout << endl;}
template<class T, class U>bool chmin(T& a, U b) {if (a > b) {a = b; return 1;} return 0;}
template<class T, class U>bool chmax(T& a, U b) {if (a < b) {a = b; return 1;} return 0;}
template<class T, class U>long long llceil(T a, U b) {return (long long)(a + b - 1) / b;}
template<class H, class...T>void wt(H&& h, T&&... t){cout<<h<<" "; wt(forward<T>(t)...);}

//-------------------------------------------------------------------------------------//

int main() {
    ll N, K, M;
    cin >> N >> M >> K;

    deque<int> dq;
    dq.pb(0);
    rep (i, 1, N) {
        if (K >= i) {
            dq.push_front(i);
            K -= i;
        }
        else if (K == 0) {
            dq.pb(i);
        }
        else {
            dq.insert(dq.end()-K, i);
            K = 0;
        }
    }

    rep (i, 0, N) {
        if (i != N - 1) wt(dq[i]);
        else wt(dq[i] + M - (N-1)*N/2);
    }
    return 0;
}
0