Submission #472140

# Submission time Handle Problem Language Result Execution time Memory
472140 2021-09-13T08:01:27 Z AbdoMo Nadan (COCI18_nadan) C++17
50 / 50
1 ms 308 KB
#include<bits/stdc++.h>
#define int long long
#define ll long long
#define pb push_back
const int mod = 1e9+7;
using namespace std;
bool comp(pair<int,int>&a ,pair<int,int>&b)
{
    if(a.first==b.first)
    {
        return a.second>b.second;
    }
    return a.first<b.first;

}
void solve()
{
    int n,k;
    cin>>k>>n;
    int i=1;
    n--;
    while(n--)
    {
        cout<<i<<endl;
        k-=i;i++;
    }
    cout<<k<<endl;

}
int32_t main(){
	int t=1;
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    //cin>>t;
	while(t--){solve();}
	return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 0 ms 204 KB Output is correct
6 Correct 1 ms 308 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 0 ms 204 KB Output is correct
9 Correct 1 ms 204 KB Output is correct
10 Correct 1 ms 204 KB Output is correct