結果

問題 No.1619 Coccinellidae
ユーザー yumaruyumaru
提出日時 2021-07-23 02:19:38
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 129 ms / 2,000 ms
コード長 1,425 bytes
コンパイル時間 1,652 ms
コンパイル使用メモリ 174,964 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-24 23:20:41
合計ジャッジ時間 4,759 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 98 ms
4,376 KB
testcase_02 AC 128 ms
4,376 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 128 ms
4,376 KB
testcase_05 AC 77 ms
4,376 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 78 ms
4,380 KB
testcase_08 AC 75 ms
4,376 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 66 ms
4,380 KB
testcase_11 AC 89 ms
4,376 KB
testcase_12 AC 2 ms
4,380 KB
testcase_13 AC 125 ms
4,380 KB
testcase_14 AC 129 ms
4,376 KB
testcase_15 AC 1 ms
4,376 KB
testcase_16 AC 2 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

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 (dq[i] != N - 1) cout << dq[i] << endl;
        else cout << dq[i] + M - (N-1)*N/2 << endl;
    }
    return 0;
}
0