Submission #109695

#TimeUsernameProblemLanguageResultExecution timeMemory
109695polyfishSeats (IOI18_seats)C++14
Compilation error
0 ms0 KiB
#include <cstdio>
#include <cstdlib>
#include <vector>
#include "seats.h"

namespace {

int read_int() {
  int x;
  if (scanf("%d", &x) != 1) {
    fprintf(stderr, "Error while reading input\n");
    exit(1);
  }
  return x;
}

}  // namespace

int main() {
  freopen("data.in", "r", stdin);
  int H = read_int();
  int W = read_int();
  int Q = read_int();
  std::vector<int> R(H * W), C(H * W);
  for (int i = 0; i < H * W; ++i) {
    R[i] = read_int();
    C[i] = read_int();
  }
  std::vector<int> A(Q), B(Q);
  for (int j = 0; j < Q; ++j) {
    A[j] = read_int();
    B[j] = read_int();
  }

  give_initial_chart(H, W, R, C);
  for (int j = 0; j < Q; ++j) {
    int answer = swap_seats(A[j], B[j]);
    printf("%d\n", answer);
  }
  return 0;
}

Compilation message (stderr)

seats.cpp: In function 'int main()':
seats.cpp:20:10: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result]
   freopen("data.in", "r", stdin);
   ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
/tmp/ccRBA0wv.o: In function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/ccn4rfSm.o:seats.cpp:(.text.startup+0x0): first defined here
/tmp/ccn4rfSm.o: In function `main':
seats.cpp:(.text.startup+0x16a): undefined reference to `give_initial_chart(int, int, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >)'
seats.cpp:(.text.startup+0x1c1): undefined reference to `swap_seats(int, int)'
/tmp/ccRBA0wv.o: In function `main':
grader.cpp:(.text.startup+0x183): undefined reference to `give_initial_chart(int, int, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >)'
grader.cpp:(.text.startup+0x220): undefined reference to `swap_seats(int, int)'
collect2: error: ld returned 1 exit status