# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
434058 | frodakcin | Seats (IOI18_seats) | C++11 | 4078 ms | 102444 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "seats.h"
#include <cassert>
#include <algorithm>
template<typename T> bool ckmax(T& a, const T& b) {return b>a?a=b,1:0;}
template<typename T> bool ckmin(T& a, const T& b) {return b<a?a=b,1:0;}
const int INF = 0x3f3f3f3f;
int H, W, N, ans;
std::vector<int> R, C;
//Subtasks 1, 2, 4
std::vector<int> maxr, minr, maxc, minc;
int calc(int u, int v)
{
for(int i=u;i<v;++i)
if(i+1 == (maxr[i+1]-minr[i+1])*(maxc[i+1]-minc[i+1]))
--ans;
for(int i=u;i<v;++i)
{
minr[i+1]=std::min(minr[i], R[i]);
maxr[i+1]=std::max(maxr[i], R[i]+1);
minc[i+1]=std::min(minc[i], C[i]);
maxc[i+1]=std::max(maxc[i], C[i]+1);
if(i+1 == (maxr[i+1]-minr[i+1])*(maxc[i+1]-minc[i+1]))
++ans;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |