Submission #1044600

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
10446002024-08-05 11:30:33happy_nodeSeats (IOI18_seats)C++17
0 / 100
4054 ms31556 KiB
#include "seats.h"
#include <bits/stdc++.h>
using namespace std;
namespace {
const int MX=1e6+5;
const array<int,4> inf={(int)1e9,0,(int)1e9,0};
int H,W;
array<int,4> arr[MX];
}
void give_initial_chart(int H, int W, std::vector<int> R, std::vector<int> C) {
::H=H, ::W=W;
for(int i=0;i<H*W;i++) {
arr[i]={R[i],R[i],C[i],C[i]};
}
}
int swap_seats(int a, int b) {
swap(arr[a],arr[b]);
int ans=0;
int L0=1e9,R0=0,L1=1e9,R1=0;
for(int i=0;i<H*W;i++) {
L0=min(L0,arr[i][0]);
L1=min(L1,arr[i][2]);
R0=min(R0,arr[i][1]);
R1=min(R1,arr[i][3]);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#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...