# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
770277 | boyliguanhan | Seats (IOI18_seats) | C++17 | 4073 ms | 24120 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "seats.h"
#pragma GCC optimize(2)
#include<bits/stdc++.h>
using namespace std;
vector<int> x, y;
void give_initial_chart(int H, int W, vector<int> R, vector<int> C) {
x=R,y=C;
}
int swap_seats(int a, int b) {
int ans = 0;
swap(x[a],x[b]);
swap(y[a],y[b]);
int A=1e7,B=0,C=1e7,D=0;
for(int i = 0; i < x.size(); i++) {
A = min(A,x[i]);
B = max(B,x[i]);
C = min(C,y[i]);
D = max(D,y[i]);
int dis = (B-A+1)*(D-C+1);
if(dis==i+1)
ans++;
}
return ans;
}
Compilation message (stderr)
# | 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... |