Submission #1213762

#TimeUsernameProblemLanguageResultExecution timeMemory
1213762badge881Nadan (COCI18_nadan)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;

const int MAXN = 1e6 + 4;
const int MOD = 1e9 + 7;
vector<int> add[MAXN];

int main()
{
    int k, n; 
    cin >> k >> n;
    vector<int> v(n + 1);
    ll sum = 0;

    for(int i = 1; i <= n; i++){
        if(i == n)
            v[i] = k - sum;
        else
            v[i] = i;
        sum += i;
    }
    for(int i = 1; i <= n; i++)
        cout << v[i] << "\n";

    return 0;
}

Compilation message (stderr)

nadan.cpp: In function 'int main()':
nadan.cpp:13:5: error: 'll' was not declared in this scope
   13 |     ll sum = 0;
      |     ^~
nadan.cpp:17:24: error: 'sum' was not declared in this scope
   17 |             v[i] = k - sum;
      |                        ^~~
nadan.cpp:20:9: error: 'sum' was not declared in this scope
   20 |         sum += i;
      |         ^~~