Submission #573438

# Submission time Handle Problem Language Result Execution time Memory
573438 2022-06-06T15:37:23 Z Rasoul006 Nadan (COCI18_nadan) C++17
50 / 50
1 ms 340 KB
#include <bits/stdc++.h>

#define endl "\n"

#define F first

#define S second

#define pb push_back

#define all(x) x.begin() , x.end()

#define mm1(dp) memset (dp , -1 , sizeof dp)

#define mm0(dp) memset (dp , 0 , sizeof dp)

#define mmo(dp) memset (dp , oo , sizeof dp)

#define mid ((r+l)>>1)

#define lx (n<<1)

#define rx ((n<<1)|1)

typedef long long ll;

using namespace std;

const int N = 1e6+5;

const int MOD = 1e9+7;

const long long oo = 4557430888798830399 ;

ll n , k ;

int main()
{
    ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);

    cin >> k >> n ;

    for (int i = 0 ; i<n-1 ; i++)
    {
        cout << i+1 << endl ;
        k-=i+1;
    }

    cout << k << endl ;



    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 324 KB Output is correct
4 Correct 0 ms 324 KB Output is correct
5 Correct 0 ms 320 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
9 Correct 1 ms 340 KB Output is correct
10 Correct 1 ms 212 KB Output is correct