Submission #139205

#TimeUsernameProblemLanguageResultExecution timeMemory
139205rajarshi_basuSeats (IOI18_seats)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "seats.h" #define FOR(i,n) for(int i=0;i<n;i++) #define FORE(i,a,b) for(int i = a;i<=b;i++) #define ll long long int #define pb push_back #define vi vector<int> #define ff first #define ss second #define ii pair<int,int> #define il pair<int,ll> using namespace std; const int MAXN = 10000; vi grid[MAXN]; ii id[MAXN]; int h;int w; int l[MAXN]; int r[MAXN]; int u[MAXN]; int d[MAXN]; bool ok[MAXN]; int cnt = 0; void update(int a,int b){ swap(id[a],id[b]); FORE(i,a,b){ if(i == 0){ l[i] = r[i] = id[i].ss u[i] = d[i] = id[i].ff; }else{ l[i] = min(l[i-1],id[i].ss); r[i] = max(r[i-1],id[i].ss); u[i] = min(l[i-1],id[i].ff); d[i] = max(r[i-1],id[i].ff); } cnt -= ok[i]; ok[i] = (r-l+1)*(d-u+1) == i+1; cnt += ok[i]; } } void give_initial_chart(int h,int w,int r[],int c[]){ ::h = h;::w = w; FOR(i,h*w){ id[i] = {r[i],c[i]}; } } int swap_seats(int a,int b){ update(a,b); return cnt; }

Compilation message (stderr)

seats.cpp: In function 'void update(int, int)':
seats.cpp:35:4: error: expected ';' before 'u'
    u[i] = d[i] = id[i].ff;
    ^