Submission #115542

#TimeUsernameProblemLanguageResultExecution timeMemory
115542WhipppedCreamSeats (IOI18_seats)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "seats.h" #pragma GCC optimize ("O3") #pragma GCC target ("sse4") using namespace std; #define X first #define Y second #define pb push_back typedef pair<int, int> ii; typedef long long ll; const int maxn = 1e6+5; int r[maxn], c[maxn]; int mnr[maxn]; int mxr[maxn]; int mnc[maxn]; int mxc[maxn]; int n, m; int ans = 0; void give_initial_chart(int H, int W, vector<int> R, vector<int> C) { n = H; m = W; for(int i = 0; i< n*m; i++) { r[i] = R[i]; c[i] = C[i]; } for(int i = 0; i< n*m; i++) { mnr[i] = min(mnr[i-1]:1e9, r[i]); mxr[i] = max(mxr[i-1]:0, r[i]); mnc[i] = min(mnc[i-1]:1e9, c[i]); mxc[i] = max(mxc[i-1]:0, c[i]); if((mxr[i]-mnr[i]+1)*(mxc[i]-mnc[i]+1) == i+1) ans++; } } int swap_seats(int a, int b) { if(a> b) swap(a, b); swap(r[a], r[b]); swap(c[a], c[b]); for(int i = a; i< b; i++) { int old = 0; if((mxr[i]-mnr[i]+1)*(mxc[i]-mnc[i]+1) == i+1) old = 1; mnr[i] = min(mnr[i-1]:1e9, r[i]); mxr[i] = max(mxr[i-1]:0, r[i]); mnc[i] = min(mnc[i-1]:1e9, c[i]); mxc[i] = max(mxc[i-1]:0, c[i]); int nw = 0; if((mxr[i]-mnr[i]+1)*(mxc[i]-mnc[i]+1) == i+1) nw = 1; ans += nw-old; } return ans; }

Compilation message (stderr)

seats.cpp: In function 'void give_initial_chart(int, int, std::vector<int>, std::vector<int>)':
seats.cpp:32:24: error: expected ')' before ':' token
   mnr[i] = min(mnr[i-1]:1e9, r[i]);
                        ^
seats.cpp:33:24: error: expected ')' before ':' token
   mxr[i] = max(mxr[i-1]:0, r[i]);
                        ^
seats.cpp:34:24: error: expected ')' before ':' token
   mnc[i] = min(mnc[i-1]:1e9, c[i]);
                        ^
seats.cpp:35:24: error: expected ')' before ':' token
   mxc[i] = max(mxc[i-1]:0, c[i]);
                        ^
seats.cpp: In function 'int swap_seats(int, int)':
seats.cpp:49:24: error: expected ')' before ':' token
   mnr[i] = min(mnr[i-1]:1e9, r[i]);
                        ^
seats.cpp:50:24: error: expected ')' before ':' token
   mxr[i] = max(mxr[i-1]:0, r[i]);
                        ^
seats.cpp:51:24: error: expected ')' before ':' token
   mnc[i] = min(mnc[i-1]:1e9, c[i]);
                        ^
seats.cpp:52:24: error: expected ')' before ':' token
   mxc[i] = max(mxc[i-1]:0, c[i]);
                        ^