Submission #117996

#TimeUsernameProblemLanguageResultExecution timeMemory
117996Osama_AlkhodairySeats (IOI18_seats)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> //#include "seats.h" #include "grader.cpp" using namespace std; const int N = 1000001; int n, m, mnx[N], mny[N], mxx[N], mxy[N]; vector <int> x, y; int cur; bool check(int g){ return (mxx[g] - mnx[g] + 1) * (mxy[g] - mny[g] + 1) == g + 1; } void update(int i){ mnx[i] = i == 0 ? x[i] : min(x[i], mnx[i - 1]); mxx[i] = i == 0 ? x[i] : max(x[i], mxx[i - 1]); mny[i] = i == 0 ? y[i] : min(y[i], mny[i - 1]); mxy[i] = i == 0 ? y[i] : max(y[i], mxy[i - 1]); } void give_initial_chart(int H, int W, std::vector<int> R, std::vector<int> C) { n = H; m = W; x = R; y = C; for(int i = 0 ; i < n * m ; i++){ update(i); cur += check(i); } } int swap_seats(int a, int b) { if(a > b) swap(a, b); for(int i = a ; i <= b ; i++){ cur -= check(i); } swap(x[a], x[b]); swap(y[a], y[b]); for(int i = a ; i <= b ; i++){ update(i); cur += check(i); } return cur; }

Compilation message (stderr)

/tmp/cc2HxS3p.o: In function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/ccrNUOow.o:seats.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status