제출 #1076623

#제출 시각아이디문제언어결과실행 시간메모리
1076623ArturgoPortal (BOI24_portal)C11
1 / 100
20 ms408 KiB
long long N,A,B,C,R,T,X,Y;int main(){scanf("%lld%lld%lld",&N,&R,&T);N--;while(N--){scanf("%lld%lld",&X,&Y);X-=R;Y-=T;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)B%=C;}if(A*C<0)A=-A;if(!A||!C)printf("-1");else printf("%lld",A*C);}

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

Main.c: In function 'main':
Main.c:1:38: warning: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    1 | long long N,A,B,C,R,T,X,Y;int main(){scanf("%lld%lld%lld",&N,&R,&T);N--;while(N--){scanf("%lld%lld",&X,&Y);X-=R;Y-=T;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)B%=C;}if(A*C<0)A=-A;if(!A||!C)printf("-1");else printf("%lld",A*C);}
      |                                      ^~~~~
Main.c:1:38: 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;int main(){scanf("%lld%lld%lld",&N,&R,&T);N--;while(N--){scanf("%lld%lld",&X,&Y);X-=R;Y-=T;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)B%=C;}if(A*C<0)A=-A;if(!A||!C)printf("-1");else printf("%lld",A*C);}
Main.c:1:234: warning: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    1 | long long N,A,B,C,R,T,X,Y;int main(){scanf("%lld%lld%lld",&N,&R,&T);N--;while(N--){scanf("%lld%lld",&X,&Y);X-=R;Y-=T;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)B%=C;}if(A*C<0)A=-A;if(!A||!C)printf("-1");else printf("%lld",A*C);}
      |                                                                                                                                                                                                                                          ^~~~~~
Main.c:1:234: warning: incompatible implicit declaration of built-in function 'printf'
Main.c:1:234: note: include '<stdio.h>' or provide a declaration of 'printf'
Main.c:1:252: warning: incompatible implicit declaration of built-in function 'printf'
    1 | long long N,A,B,C,R,T,X,Y;int main(){scanf("%lld%lld%lld",&N,&R,&T);N--;while(N--){scanf("%lld%lld",&X,&Y);X-=R;Y-=T;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)B%=C;}if(A*C<0)A=-A;if(!A||!C)printf("-1");else printf("%lld",A*C);}
      |                                                                                                                                                                                                                                                            ^~~~~~
Main.c:1:252: 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...