# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
104350 |
2019-04-05T14:18:35 Z |
tmk |
popa (BOI18_popa) |
C++17 |
|
18 ms |
376 KB |
#include<bits/stdc++.h>
#include"popa.h"
using namespace std;
#ifndef d
#define d(...)
#endif
#define st first
#define nd second
#define pb push_back
#define siz(c) (int)(c).size()
#define all(c) (c).begin(), (c).end()
typedef long long LL;
typedef long double LD;
constexpr int INF=1e9+7;
constexpr LL INFL=1e18;
template<class L, class R> ostream &operator<<(ostream &os, pair<L,R> P) {
return os << "(" << P.st << "," << P.nd << ")";
}
int solve(int n, int *L, int *R) {
fill_n(L, n, -1);
fill_n(R, n, -1);
int top = 0, cur = 0, lst = 0;
while(cur < n-1) {
if(query(cur, cur, cur, cur+1)) {
if(lst != cur)
R[lst] = cur;
lst = cur++;
}
else if(query(top, cur+1, cur+1, cur+1)) {
if(lst != cur)
R[lst] = cur;
L[cur+1] = top;
top = lst = ++cur;
} else {
L[cur+1] = cur;
cur++;
}
}
if(lst != cur) R[lst] = cur;
return top;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
5 ms |
376 KB |
not a valid solution |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
18 ms |
372 KB |
not a valid solution |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
14 ms |
324 KB |
not a valid solution |
2 |
Halted |
0 ms |
0 KB |
- |