# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
472244 | HossamHero7 | Nadan (COCI18_nadan) | C++14 | 1 ms | 204 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;
typedef long long ll;
#define endl '\n'
void solve(){
int k,n;
cin>>k>>n;
vector <int> v(n);
ll sum = 0;
for(int i=0;i<n-1;i++){
v[i] = i+1;
sum += i+1;
}
ll ans = k - sum;
v[n-1] = ans;
for(auto i : v){
cout<<i<<endl;
}
}
int main()
{
int t=1;
// cin>>t;
while(t--){
solve();
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |