Submission #1095008

# Submission time Handle Problem Language Result Execution time Memory
1095008 2024-10-01T07:11:38 Z haianhnguyen08102007 Nadan (COCI18_nadan) C++17
50 / 50
1 ms 420 KB
/*

............................................................
............................................................
............................................................
............................................................
............................................................
..............................*.............................
..............................*.............................
.............................*.*............................
.............................*.*............................
............................*...*...........................
............................*...*...........................
............................*...*...........................
...........................*.....*..........................
...........................*.....*..........................
..........................*.......*.........................
......................*****.......******....................
................******..................*****...............
.................*........................**................
..................**.....................*..................
....................*...................*...................
.....................*................**....................
......................**.............*......................
........................*...........*.......................
........................*...........*.......................
........................*...........*.......................
.......................*.............*......................
.......................*.............*......................
.......................*......*......*......................
.......................*....**.**....*......................
.......................*..**.....*...*......................
......................*..*........**..*.....................
......................***...........***.....................
......................*...............*.....................
............................................................
............................................................
............................................................
............................................................
............................................................
............................................................
............................................................
  CONG HOA XA HOI CHU NHGIA VIET NAM - HO CHI MINH MUON NAM

*/

#include <bits/stdc++.h>
#define ll long long
//#define int long long
//#define float double
#define fi first
#define se second
#define pii pair<int, int>
#define pb push_back
#define rtrn return
#define FOR(i, a, b) for (ll i=(a); i<=(b); i++)
#define FORD(i, a, b) for (ll i=(a); i>=(b); i--)
#define BIT(i,x) (((i)>>(x))&1)
#define sum(l, r) (sum[r]-sum[(l)-1])
#define all(x) x.begin(),x.end()
#define rep(caichojv, x) for (ll caichojv=1; caichojv<=x; caichojv++)

//#pragma GCC optimize(" unroll-loops")
//#pragma gcc optimize("Ofast")
//#pragma GCC optimization("Ofast")
//#pragma optimize(Ofast)
//#pragma GCC optimize("O3")

using namespace std;

const ll N = 1e7+1;
const ll Mod = 1e9+7;
const ll INF = 1e9;
const ll nmax = 600005;
const ll MOD = 1e9+7;
const ll M = 2e6;
const float PI  = 3.14159265359;

signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);

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

    return 0;
}
// NGUYEN LUU HAI ANH DEP TRAI SO 1 THE GIOI //
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 420 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 1 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct