Submission #472147

# Submission time Handle Problem Language Result Execution time Memory
472147 2021-09-13T08:12:44 Z MamdouhN Nadan (COCI18_nadan) C++14
15 / 50
1 ms 204 KB
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define endl "\n"
main()
{
    int n,k;
    cin>>k>>n;
    k-=(n*(n+1))/2;
    int extra=k%n;
    int addtoall=(k-(k%n))/n;
    for(int i=0;i<n;i++)
    {
        cout<<i+1+addtoall+(i==n-1?extra:0)<<endl;
    }
}

Compilation message

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