Submission #1119215

#TimeUsernameProblemLanguageResultExecution timeMemory
1119215MateiKing80Sum Zero (RMI20_sumzero)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>

using namespace std;

int lift[17][1 << 17];

int main()
{
    int n, q;
    cin >> n >> q;
    for(int i = 1; i <= n; i ++)
        cin >> a[i], a[i] += a[i - 1];
    map<int, int> mp;
    int last = n + 1; //se termina aici
    for(int i = n; i; i --)
    {
        if(mp[a[i]] != 0)
            last = min(last, mp[a[i]]);
        mp[a[i]] = i;

    }
}
/*
ne trebuie prima pereche de sume partiale egale care se afla
la dreapta unui punct
si facem binary lifting pe tot
yessir
*/

Compilation message (stderr)

sumzero.cpp: In function 'int main()':
sumzero.cpp:12:16: error: 'a' was not declared in this scope
   12 |         cin >> a[i], a[i] += a[i - 1];
      |                ^
sumzero.cpp:17:15: error: 'a' was not declared in this scope
   17 |         if(mp[a[i]] != 0)
      |               ^
sumzero.cpp:19:12: error: 'a' was not declared in this scope
   19 |         mp[a[i]] = i;
      |            ^