# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1000013 | LilPluton | Nadan (COCI18_nadan) | C++14 | 1 ms | 604 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
// author : Pluton
#define OPT ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define int ll
#define ll long long
#define pb push_back
#define arr array
#define fi first
#define se second
#define rep(i,j,k) for(int i = j; i <= k; ++i)
#define all(a) a.begin(),a.end()
#define pii pair<int,int>
#define endll '\n'
using namespace std;
const int INF = 1e18;
struct BIT
{
int n;
vector<int> ft;
void init(int N)
{
n = N + 5;
ft.assign(n + 5, 0);
}
void add(int pos, int val)
{
for (pos = pos + 1; pos <= n; pos += pos & -pos) ft[pos] += val;
}
int get(int pos, int res = 0)
{
for (pos = pos + 1; pos > 0; pos -= pos & -pos) res += ft[pos];
return res;
}
};
void _()
{
int n, k;
cin >> k >> n;
for(int i = 1; i < n; ++i)
cout << i << endll, k -= i;
cout << k << endll;
}
signed main()
{
OPT
int tc = 1;
while(tc--)
_();
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |