Submission #298458

#TimeUsernameProblemLanguageResultExecution timeMemory
298458Pichon5Seats (IOI18_seats)C++17
11 / 100
4025 ms24184 KiB
#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 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...