제출 #1266434

#제출 시각아이디문제언어결과실행 시간메모리
1266434canhnam357Nadan (COCI18_nadan)C++20
50 / 50
0 ms328 KiB
// source problem : 
#include <bits/stdc++.h>
using namespace std;
#define all(x) x.begin(), x.end()
#define int long long
#define lb lower_bound
#define ub upper_bound
#define MASK(i) (1LL << (i))
const int inf = 1e18;
void ckmax(int& f, int s)
{
    f = (f > s ? f : s);
}
void ckmin(int& f, int s)
{
    f = (f < s ? f : s);
}
int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int k, n;
    cin >> k >> n;
    for (int i = 1; i <= n; i++) {
        if (i == n) cout << k << '\n';
        else {
            k -= i;
            cout << i << '\n';
        }
    }   
    return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...