(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 #1106655

#TimeUsernameProblemLanguageResultExecution timeMemory
1106655snpmrnhlolSeats (IOI18_seats)C++17
5 / 100
4061 ms43848 KiB
#include "seats.h" #include <bits/stdc++.h> using namespace std; std::vector<std::vector<int>> v; vector <int> x,y; int n,m; void give_initial_chart(int n2, int m2, std::vector<int> a, std::vector<int> b) { n = n2;m = m2; v.assign(n, vector<int>(m,0)); x = a; y = b; for(int i = 0;i < n*m;i++){ v[a[i]][b[i]] = i; } } int swap_seats(int a, int b){ swap(x[a],x[b]); swap(y[a],y[b]); int ans = 0; for(int i = 0;i < n*m;i++){ int r = -1,l = m,d = -1,u = n; for(int j = 0;j <= i;j++){ l = min(l,y[j]); r = max(r,y[j]); u = min(u,x[j]); d = max(d,x[j]); } if((r - l + 1)*(d - u + 1) == i + 1){ ans++; } //cout<<l<<' '<<r<<' '<<u<<' '<<d<<' '<<i<<'\n'; } return ans; } /** 2 3 1 0 0 1 0 1 1 0 1 0 2 1 2 0 5 **/
#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...