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;
#ifdef EVAL
#else
#include"grader.cpp"
#endif
vector<pair<int,int>>v;
int h,w;
void give_initial_chart(int H,int W,vector<int>x,vector<int>y){
h=H,w=W;
for(int i=0;i<h*w;i++)v.push_back({x[i],y[i]});
}
int swap_seats(int a,int b){
swap(v[a],v[b]);
int cnt=0,l=2e9,r=0,u=2e9,d=0;
for(int i=0;i<h*w;i++){
l=min(l,v[i].first);
r=max(r,v[i].first);
u=min(u,v[i].second);
d=max(d,v[i].second);
if((r-l+1)*(d-u+1)==i+1)cnt++;
}
return cnt;
}
# | 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... |