Submission #1066715

#TimeUsernameProblemLanguageResultExecution timeMemory
1066715Faisal_SaqibSeats (IOI18_seats)C++17
0 / 100
4018 ms44220 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...