Submission #94160

#TimeUsernameProblemLanguageResultExecution timeMemory
94160someone_aaSeats (IOI18_seats)C++17
11 / 100
4091 ms41040 KiB
#include <bits/stdc++.h> #include "seats.h" #define pb push_back using namespace std; vector<int> r; vector<int> c; int h, w; void give_initial_chart(int H, int W, vector<int> R, vector<int> C) { h = H; w = W; for(int i=0;i<H*W;i++) { r.pb(R[i]); c.pb(C[i]); } } int swap_seats(int a, int b) { swap(r[a], r[b]); swap(c[a], c[b]); int max_x = INT_MIN, min_x = INT_MAX; int max_y = INT_MIN, min_y = INT_MAX; int br = 0; for(int i=0;i<h*w;i++) { max_x = max(max_x, r[i]); min_x = min(min_x, r[i]); max_y = max(max_y, c[i]); min_y = min(min_y, c[i]); if(i + 1 == (max_x-min_x+1)*(max_y-min_y+1)) { br++; } } return br; }
#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...