# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
116721 | tselmegkh | Nadan (COCI18_nadan) | C++14 | 2 ms | 384 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>
using namespace std;
#define INF 1e9
#define MAX 100005
#define xx first
#define yy second
#define pb push_back
#define mp make_pair
#define ull long long
#define FOR(i,a,b) for(int i=a;i<=b;i++)
#define nl '\n'
#define zai <<' '<<
#define all(a) a.begin(),a.end()
#define pc __builtin_popcount
#define debug(x) cerr << #x << " = " << (x) << ", "
typedef vector<int> vi;
typedef pair<int,int> ii;
typedef vector<ii> vii;
template<class C> void mini(C &_a, C _b) { _a = min(_a, _b); }
template<class C> void maxi(C &_a, C _b) { _a = max(_a, _b); }
int main(){
ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
int k,n;
cin >> k >> n;
if(n==1){
cout << k;
return 0;
}
ull sum=0;
for(int i=1;i<=n-1;i++){
sum+=i;
cout << i << nl;
}
assert(k-sum>=0);
cout << k-sum;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |