제출 #431665

#제출 시각아이디문제언어결과실행 시간메모리
431665MDario자리 배치 (IOI18_seats)C++11
11 / 100
4078 ms24612 KiB
#include "seats.h" #include<bits/stdc++.h> using namespace std; vector<int> r, c; int s=0, n; void give_initial_chart(int H, int W, vector<int> R, vector<int> C) { r=R; c=C; n=H*W; return; } int swap_seats(int a, int b) { if(a>b)swap(a, b); swap(r[a], r[b]); swap(c[b], c[a]); int u=r[0], d=r[0], l=c[0], r1=c[0]; s=1; for(int i=1; i<n; i++){ u=max(u, r[i]); r1=max(r1, c[i]); d=min(d, r[i]); l=min(l, c[i]); if((r1-l+1)*(u-d+1)==i+1)s++; } return s; }
#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...