(UPD: 2024-12-04 14:48 UTC) Judge is not working due to Cloudflare incident. (URL) We can do nothing about it, sorry. After the incident is resolved, we will grade all submissions.

Submission #1105286

#TimeUsernameProblemLanguageResultExecution timeMemory
1105286thelegendary08Seats (IOI18_seats)C++14
11 / 100
4062 ms43424 KiB
#include "seats.h" #include<bits/stdc++.h> #define f0r(i,n) for(int i=0; i<n; i++) #define pb push_back #define vi vector<int> #define pii pair<int,int> using namespace std; vector<pair<int,int>>v; int h, w; void give_initial_chart(int H, int W, std::vector<int> R, std::vector<int> C) { h = H; w = W; f0r(i, H * W){ v.pb({R[i], C[i]}); } } int swap_seats(int a, int b) { swap(v[a], v[b]); pii x = {v[0].first, v[0].first}; pii y = {v[0].second, v[0].second}; int ans = 0; f0r(i, h*w){ x.first = min(v[i].first, x.first); x.second = max(v[i].first, x.second); y.first = min(v[i].second, y.first); y.second = max(v[i].second, y.second); if((x.second - x.first + 1) * (y.second - y.first + 1) == i+1)ans++; } return ans; }
#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...