Submission #1076608

#TimeUsernameProblemLanguageResultExecution timeMemory
1076608ArturgoPortal (BOI24_portal)C++14
Compilation error
0 ms0 KiB
long long N,A,B,C,R,T,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) { R=A/X; A -= R * X; B -= R * Y; T=A;A=X;X=T; T=B;B=Y;Y=T; } while(Y) { C%=Y; T=Y;Y=C;C=T; } if(C != 0)B%=C; } if(A*C<0)A=-A;if(A==0||C==0)printf("-1");else printf("%lld",A*C); }

Compilation message (stderr)

Main.cpp: In function 'int main()':
Main.cpp:3:5: error: 'scanf' was not declared in this scope
    3 |     scanf("%lld%lld%lld",&N,&OX,&OY);N--;
      |     ^~~~~
Main.cpp:19:5: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
   19 |     if(A*C<0)A=-A;if(A==0||C==0)printf("-1");else printf("%lld",A*C);
      |     ^~
Main.cpp:19:19: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
   19 |     if(A*C<0)A=-A;if(A==0||C==0)printf("-1");else printf("%lld",A*C);
      |                   ^~
Main.cpp:19:33: error: 'printf' was not declared in this scope
   19 |     if(A*C<0)A=-A;if(A==0||C==0)printf("-1");else printf("%lld",A*C);
      |                                 ^~~~~~
Main.cpp:1:1: note: 'printf' is defined in header '<cstdio>'; did you forget to '#include <cstdio>'?
  +++ |+#include <cstdio>
    1 | long long N,A,B,C,R,T,X,Y,OX,OY;
Main.cpp:19:51: error: 'printf' was not declared in this scope
   19 |     if(A*C<0)A=-A;if(A==0||C==0)printf("-1");else printf("%lld",A*C);
      |                                                   ^~~~~~
Main.cpp:19:51: note: 'printf' is defined in header '<cstdio>'; did you forget to '#include <cstdio>'?