Submission #1119223

#TimeUsernameProblemLanguageResultExecution timeMemory
1119223MateiKing80Sum Zero (RMI20_sumzero)C++14
0 / 100
7 ms37456 KiB
#include <bits/stdc++.h> using namespace std; int lift[19][1 << 19]; int a[1 << 19]; int main() { int n, q; cin >> n >> q; for(int i = 1; i <= n; i ++) cin >> a[i], a[i] += a[i - 1]; for(int i = 0; i < 17; i ++) for(int j = 0; j < (1 << 17); j ++) lift[i][j] = i + j; 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 */
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...