Submission #348156

#TimeUsernameProblemLanguageResultExecution timeMemory
348156juggernautSeats (IOI18_seats)C++14
0 / 100
4072 ms24308 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++; } if(cnt>=h+w-1)exit(1); 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...