| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 791278 | Mouad_ouj | 자리 배치 (IOI18_seats) | C++17 | 4085 ms | 39740 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
#include "seats.h"
using namespace std;
vector<int> r,c;
int h,w;
void give_initial_chart(int hh, int ww,vector<int> rr,vector<int> cc)
{
h=hh,w=ww;
r.resize(h*w);
c.resize(h*w);
r=rr;
c=cc;
}
int swap_seats(int a, int b)
{
swap(r[a],r[b]);
swap(c[a],c[b]);
int ans=1,smin=c[0],smax=c[0],emin=r[0],emax=r[0];
for(int x=1;x<h*w;x++)
{
if(!(c[x]>=smin && c[x]<=smax && r[x]>=emin && r[x]<=emax))
{
smin=min(smin,c[x]);
smax=max(smax,c[x]);
emin=min(emin,r[x]);
emax=max(emax,r[x]);
ans++;
}
}
return ans;
}| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
