Submission #239968

# Submission time Handle Problem Language Result Execution time Memory
239968 2020-06-17T15:32:27 Z DS007 Nadan (COCI18_nadan) C++14
50 / 50
5 ms 388 KB
#include <bits/stdc++.h>
using namespace std;

int solveTestCase() {
    int k, n, s = 0;
    cin >> k >> n;

    for (int i = 0; i < n - 1; i++)
        cout << i + 1 << "\n", s += i + 1;
    cout << k - s;
}

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);

    int test = 1;
    // cin >> test;
    while (test--)
        solveTestCase();
}

Compilation message

nadan.cpp: In function 'int solveTestCase()':
nadan.cpp:11:1: warning: no return statement in function returning non-void [-Wreturn-type]
 }
 ^
# Verdict Execution time Memory Grader output
1 Correct 5 ms 384 KB Output is correct
2 Correct 4 ms 384 KB Output is correct
3 Correct 4 ms 384 KB Output is correct
4 Correct 5 ms 360 KB Output is correct
5 Correct 5 ms 384 KB Output is correct
6 Correct 5 ms 384 KB Output is correct
7 Correct 5 ms 384 KB Output is correct
8 Correct 5 ms 388 KB Output is correct
9 Correct 5 ms 384 KB Output is correct
10 Correct 5 ms 384 KB Output is correct