Submission #1076607

#TimeUsernameProblemLanguageResultExecution timeMemory
1076607ArturgoPortal (BOI24_portal)C11
1 / 100
14 ms416 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=Y; } 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.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,T,X,Y,OX,OY;
Main.c: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.c: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.c:19:33: warning: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   19 |     if(A*C<0)A=-A;if(A==0||C==0)printf("-1");else printf("%lld",A*C);
      |                                 ^~~~~~
Main.c:19:33: warning: incompatible implicit declaration of built-in function 'printf'
Main.c:19:33: note: include '<stdio.h>' or provide a declaration of 'printf'
Main.c:19:51: warning: incompatible implicit declaration of built-in function 'printf'
   19 |     if(A*C<0)A=-A;if(A==0||C==0)printf("-1");else printf("%lld",A*C);
      |                                                   ^~~~~~
Main.c:19:51: note: include '<stdio.h>' or provide a declaration of 'printf'
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...