Submission #839108

# Submission time Handle Problem Language Result Execution time Memory
839108 2023-08-28T16:25:14 Z Bula Nadan (COCI18_nadan) C++14
50 / 50
1 ms 260 KB
#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define pb push_back
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define ff first
#define sc second
#define int ll
const ll mod = 1e9 + 7, N = 1e5 + 1;

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

Compilation message

nadan.cpp:13:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   13 | main(){
      | ^~~~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 1 ms 260 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 1 ms 212 KB Output is correct