제출 #600925

#제출 시각아이디문제언어결과실행 시간메모리
600925enerelt14자리 배치 (IOI18_seats)C++14
11 / 100
4083 ms40872 KiB
#include "seats.h" #include<bits/stdc++.h> using namespace std; vector<int> r, c, num; int h, w; bool vis[10005][10005]; void give_initial_chart(int H, int W, vector<int> R, vector<int> C) { h=H; w=W; r=R; c=C; } int swap_seats(int a, int b){ for (int i=0;i<h;i++)for (int j=0;j<w;j++)vis[i][j]=0; swap(r[a], r[b]); swap(c[a], c[b]); int mnr=h, mxr=0, mnc=w, mxc=0, ans=0; for (int i=0;i<h*w;i++){ vis[r[i]][c[i]]=1; mnr=min(mnr, r[i]); mxr=max(mxr, r[i]); mnc=min(mnc, c[i]); mxc=max(mxc, c[i]); if ((mxr-mnr+1)*(mxc-mnc+1)==i+1 && vis[mxr][mxc] && vis[mnr][mnc])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...