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;
vector<int>r,c;
int h,w;
void give_initial_chart(int H, int W, std::vector<int> R, std::vector<int> C)
{
r=R;
c=C;
h=H;
w=W;
}
int swap_seats(int a, int b)
{
swap(r[a],r[b]);
swap(c[a],c[b]);
int miy=r[0];
int mix=c[0];
int may=r[0];
int maax=c[0];
int res=1;
for(int i=1; i<h*w; i++)
{
miy=min(miy,r[i]);
mix=min(mix,c[i]);
may=max(may,r[i]);
maax=max(maax,c[i]);
if((maax-mix+1)*(may-miy+1)==(i+1)){
res++;
}
}
return res;
}
# | 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... |