제출 #115364

#제출 시각아이디문제언어결과실행 시간메모리
115364dsjong자리 배치 (IOI18_seats)C++14
11 / 100
1265 ms49272 KiB
#include "seats.h" #include <bits/stdc++.h> using namespace std; int M,N; int r[10005],c[10005]; void give_initial_chart(int H, int W, std::vector<int> R, std::vector<int> C) { M=H,N=W; for(int i=0;i<M*N;i++){ r[i]=R[i]; c[i]=C[i]; } } int swap_seats(int a, int b){ swap(r[a],r[b]); swap(c[a],c[b]); int ans=0; int maxr=0,minr=1e9,maxc=0,minc=1e9; for(int i=0;i<M*N;i++){ maxr=max(maxr,r[i]); minr=min(minr,r[i]); maxc=max(maxc,c[i]); minc=min(minc,c[i]); if((maxr-minr+1)*(maxc-minc+1)==i+1) 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...