Submission #431665

#TimeUsernameProblemLanguageResultExecution timeMemory
431665MDarioSeats (IOI18_seats)C++11
11 / 100
4078 ms24612 KiB
#include "seats.h" #include<bits/stdc++.h> using namespace std; vector<int> r, c; int s=0, n; void give_initial_chart(int H, int W, vector<int> R, vector<int> C) { r=R; c=C; n=H*W; return; } int swap_seats(int a, int b) { if(a>b)swap(a, b); swap(r[a], r[b]); swap(c[b], c[a]); int u=r[0], d=r[0], l=c[0], r1=c[0]; s=1; for(int i=1; i<n; i++){ u=max(u, r[i]); r1=max(r1, c[i]); d=min(d, r[i]); l=min(l, c[i]); if((r1-l+1)*(u-d+1)==i+1)s++; } return s; }
#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...