제출 #807958

#제출 시각아이디문제언어결과실행 시간메모리
807958Shithila자리 배치 (IOI18_seats)C++14
0 / 100
174 ms48156 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; for(int i=0;i<H;i++) { for(int j=0;j<W;j++) { grid[r[i]][c[i]]=i; } } } int swap_seats(int a, int b) { int k=r[a]; r[a]=r[b]; r[b]=k; k=c[a]; c[a]=c[b]; c[b]=k; 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...