Submission #447680

#TimeUsernameProblemLanguageResultExecution timeMemory
447680MilosMilutinovicSeats (IOI18_seats)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long unsigned long ull; typedef double long ld; int h, w, r[1000005], c[1000005]; void give_initial_chart(int H, int W, int R[], int C[]) { h = H; w = W; for (int i = 0; i < h * w; i++) r[i] = R[i]; for (int i = 0; i < h * w; i++) c[i] = C[i]; } int swap_seats(int a, int b) { if (h * w <= 10000) { int ans = 0; pair<int, int> mn, mx; mx = mn = {r[0], c[0]}; for (int i = 0; i < h * w; i++) { mx.first = max(mx.first, r[i]); mx.second = max(mx.second, c[i]); mn.first = min(mn.first, r[i]); mn.second = min(mn.second, c[i]); if ((mx.first - mn.first + 1) * (mx.second - mn.second + 1) == i + 1) { ans++; } } return ans; } }

Compilation message (stderr)

seats.cpp: In function 'int swap_seats(int, int)':
seats.cpp:32:1: warning: control reaches end of non-void function [-Wreturn-type]
   32 | }
      | ^
/usr/bin/ld: /tmp/ccseuFaU.o: in function `main':
grader.cpp:(.text.startup+0x22f): undefined reference to `give_initial_chart(int, int, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status