Submission #348002

#TimeUsernameProblemLanguageResultExecution timeMemory
348002juggernautSeats (IOI18_seats)C++14
11 / 100
4085 ms41448 KiB
#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 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...