Submission #808015

#TimeUsernameProblemLanguageResultExecution timeMemory
808015ShithilaSeats (IOI18_seats)C++14
0 / 100
4065 ms27700 KiB
#include "seats.h" #include<bits/stdc++.h> using namespace std; std::vector<int> r; std::vector<int> c; vector<vector<int> > grid; int h; int 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; grid.resize(H,vector<int>(W)); for(int i=0;i<H*W;i++) { grid[r[i]][c[i]]=i; } } int swap_seats(int a, int b) { swap(r[a], r[b]); swap(c[a], c[b]); grid[r[a]][c[a]]=a; grid[r[b]][c[b]]=b; int ans=0; for(int hi=0;hi<=r[0];hi++) { for(int hj=r[0];hj<h;hj++) { for(int ci=0;ci<=c[0];ci++) { for(int cj=c[0];cj<h;cj++) { bool chek=true; for(int i=hi;i<=hj;i++) { for(int j=ci;j<=cj;j++) { if(grid[i][j]>((cj-ci+1)*(hj-hi+1))) { chek=false; } } } if(chek==true) ans++; } } } } return ans; }
#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...