| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 406139 | Antekb | Seats (IOI18_seats) | C++14 | 4078 ms | 40748 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"
#include<bits/stdc++.h>
using namespace std;
vector<int> R, C;
int h, w;
void give_initial_chart(int H, int W, std::vector<int> R2, std::vector<int> C2) {
R=R2;
C=C2;
h=H;
w=W;
}
int swap_seats(int a, int b) {
swap(R[a], R[b]);
swap(C[a], C[b]);
int x1=R[0], x2=R[0], y1=C[0], y2=C[0];
int M=0, ans=0;
for(int i=1; i<h*w; i++){
x1=min(x1, R[i]);
x2=max(x2, R[i]);
y1=min(y1, C[i]);
y2=max(y2, C[i]);
if(i==(x2-x1+1)*(y2-y1+1)-1)ans++;
}
return ans+1;
}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... | ||||
