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 <bits/stdc++.h>
using namespace std;
int n,h,w;
vector<pair<int,int>> seats;
vector<vector<int>> grid;
void give_initial_chart(int H, int W, std::vector<int> R, std::vector<int> C)
{
grid.resize(H,vector<int>(W));
h=H;w=H;n=R.size();
for(int i=0;i<n;i++)
seats.push_back({R[i],C[i]});
}
int swap_seats(int a, int b)
{
swap(seats[a],seats[b]);
int mx_row=-n,mx_col=-n,mi_row=n,mi_col=n;
set<pair<pair<int,int>,pair<int,int>>> tp;
for(int i=0;i<n;i++)
{
int x=seats[i].first;
int y=seats[i].second;
mx_col=max(mx_col,y);
mi_col=min(mi_col,y);
mx_row=max(mx_row,x);
mi_row=min(mi_row,x);
tp.insert({{mi_row,mi_col},{mx_row,mx_col}});
}
return tp.size();
}
# | 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... |