# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
61940 | 2018-07-27T05:58:05 Z | koosaga(#1793) | popa (BOI18_popa) | C++11 | 3 ms | 308 KB |
#include <bits/stdc++.h> #include "popa.h" using namespace std; typedef pair<int, int> pi; typedef long long lint; int solve(int N, int *l, int *r){ for(int i=0; i<N; i++) l[i] = r[i] = -1; int cur_root = 0; for(int i=1; i<N; i++){ vector<int> v; for(int j=cur_root; j!=-1; j=r[j]){ v.push_back(j); } while(v.size()){ int pos = v.back(); while(l[pos] != -1) pos = l[pos]; if(query(l[pos], i, v.back(), v.back()) == 1){ break; } else v.pop_back(); } if(v.empty()){ l[i] = cur_root; cur_root = i; } else{ r[v.back()] = i; } } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 248 KB | invalid argument |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 3 ms | 308 KB | invalid argument |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 3 ms | 308 KB | invalid argument |
2 | Halted | 0 ms | 0 KB | - |