# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
145243 | kdh9949 | Seats (IOI18_seats) | C++17 | 4102 ms | 45600 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 <bits/stdc++.h>
using namespace std;
const int N = 1000005;
int n, x[N], y[N], mx[N], Mx[N], my[N], My[N], r;
void cal(int a[], int m[], int M[], int s, int e){
for(int i = s; i <= e; i++){
m[i] = min(m[i - 1], a[i]);
M[i] = max(M[i - 1], a[i]);
}
}
void ch(int s, int e, int x){
for(int i = s; i <= e; i++)
if(1LL * (Mx[i] - mx[i] + 1) * (My[i] - my[i] + 1) == i) r += x;
}
void give_initial_chart(int H, int W, vector<int> R, vector<int> C) {
n = H * W;
for(int i = 0; i < n; i++){
x[i + 1] = R[i];
y[i + 1] = C[i];
}
mx[0] = my[0] = N;
cal(x, mx, Mx, 1, n);
cal(y, my, My, 1, n);
ch(1, n, 1);
# | 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... |