제출 #1076578

#제출 시각아이디문제언어결과실행 시간메모리
1076578ArturgoPortal (BOI24_portal)C11
컴파일 에러
0 ms0 KiB
long long N,A,B,C,R,X,Y,OX,OY; int main() { scanf("%lld%lld%lld",&N,&OX,&OY);N--; while(N--) { scanf("%lld%lld",&X,&Y); X -= OX; Y -= OY; while(X != 0) { R = A / X; A -= R * X; B -= R * Y; swap(A, X); swap(B, Y); } while(Y != 0) { C %= Y; swap(C, Y); } if(C != 0) { B %= C; } } if(A == 0 || C == 0) printf("-1"); else printf("%lld",abs(A*C)); }

컴파일 시 표준 에러 (stderr) 메시지

Main.c: In function 'main':
Main.c:3:5: warning: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    3 |     scanf("%lld%lld%lld",&N,&OX,&OY);N--;
      |     ^~~~~
Main.c:3:5: warning: incompatible implicit declaration of built-in function 'scanf'
Main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | long long N,A,B,C,R,X,Y,OX,OY;
Main.c:10:13: warning: implicit declaration of function 'swap' [-Wimplicit-function-declaration]
   10 |             swap(A, X); swap(B, Y);
      |             ^~~~
Main.c:18:26: warning: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   18 |     if(A == 0 || C == 0) printf("-1");
      |                          ^~~~~~
Main.c:18:26: warning: incompatible implicit declaration of built-in function 'printf'
Main.c:18:26: note: include '<stdio.h>' or provide a declaration of 'printf'
Main.c:19:10: warning: incompatible implicit declaration of built-in function 'printf'
   19 |     else printf("%lld",abs(A*C));
      |          ^~~~~~
Main.c:19:10: note: include '<stdio.h>' or provide a declaration of 'printf'
Main.c:19:24: warning: implicit declaration of function 'abs' [-Wimplicit-function-declaration]
   19 |     else printf("%lld",abs(A*C));
      |                        ^~~
Main.c:19:29: warning: 'abs' argument 1 type is 'long long int' where 'int' is expected in a call to built-in function declared without prototype [-Wbuiltin-declaration-mismatch]
   19 |     else printf("%lld",abs(A*C));
      |                            ~^~
<built-in>: note: built-in 'abs' declared here
Main.c:19:21: warning: format '%lld' expects argument of type 'long long int', but argument 2 has type 'int' [-Wformat=]
   19 |     else printf("%lld",abs(A*C));
      |                  ~~~^  ~~~~~~~~
      |                     |  |
      |                     |  int
      |                     long long int
      |                  %d
/usr/bin/ld: /tmp/ccOomc6s.o: in function `main':
Main.c:(.text.startup+0xd6): undefined reference to `swap'
/usr/bin/ld: Main.c:(.text.startup+0xeb): undefined reference to `swap'
/usr/bin/ld: Main.c:(.text.startup+0x129): undefined reference to `swap'
collect2: error: ld returned 1 exit status