Submission #39325

#TimeUsernameProblemLanguageResultExecution timeMemory
3932514kgRobots (IOI13_robots)C++11
Compilation error
0 ms0 KiB
#include <stdio.h> #include <stdlib.h> #include "robots.h" #define MAX_A 50000 #define MAX_B 50000 #define MAX_T 500000 static int X[MAX_A]; static int Y[MAX_B]; static int W[MAX_T]; static int S[MAX_T]; int main() { int A, B, T, i; FILE *f = fopen("sample1.in", "r"); fscanf(f, "%d", &A); fscanf(f, "%d", &B); fscanf(f, "%d", &T); for (i = 0; i < A; i++) fscanf(f, "%d", &X[i]); for (i = 0; i < B; i++) fscanf(f, "%d", &Y[i]); for (i = 0; i < T; i++) fscanf(f, "%d%d", &W[i], &S[i]); int answer = putaway(A, B, T, X, Y, W, S); printf("%d\n", answer); return 0; }

Compilation message (stderr)

robots.cpp: In function 'int main()':
robots.cpp:19:21: warning: ignoring return value of 'int fscanf(FILE*, const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  fscanf(f, "%d", &A);
                     ^
robots.cpp:20:21: warning: ignoring return value of 'int fscanf(FILE*, const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  fscanf(f, "%d", &B);
                     ^
robots.cpp:21:21: warning: ignoring return value of 'int fscanf(FILE*, const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  fscanf(f, "%d", &T);
                     ^
robots.cpp:23:48: warning: ignoring return value of 'int fscanf(FILE*, const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  for (i = 0; i < A; i++) fscanf(f, "%d", &X[i]);
                                                ^
robots.cpp:24:48: warning: ignoring return value of 'int fscanf(FILE*, const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  for (i = 0; i < B; i++) fscanf(f, "%d", &Y[i]);
                                                ^
robots.cpp:25:57: warning: ignoring return value of 'int fscanf(FILE*, const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  for (i = 0; i < T; i++) fscanf(f, "%d%d", &W[i], &S[i]);
                                                         ^
/tmp/ccDBlNEu.o: In function `main':
robots.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/cc85mthr.o:grader.c:(.text.startup+0x0): first defined here
/tmp/cc85mthr.o: In function `main':
grader.c:(.text.startup+0x180): undefined reference to `putaway'
/tmp/ccDBlNEu.o: In function `main':
robots.cpp:(.text.startup+0x133): undefined reference to `putaway'
collect2: error: ld returned 1 exit status