結果
| 問題 | No.321 (P,Q)-サンタと街の子供たち |
| コンテスト | |
| ユーザー |
testestest
|
| 提出日時 | 2016-02-03 09:23:19 |
| 言語 | C90 (gcc 12.4.0) |
| 結果 |
AC
|
| 実行時間 | 28 ms / 2,000 ms |
| コード長 | 158 bytes |
| 記録 | |
| コンパイル時間 | 180 ms |
| コンパイル使用メモリ | 29,256 KB |
| 最終ジャッジ日時 | 2026-02-23 20:31:48 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 41 |
コンパイルメッセージ
main.c:1:1: warning: data definition has no type or storage class
1 | s,p,q,x,y;main(f){for(scanf("%d%d%d",&p,&q,&s),y=p,f=q;x=y;f=x)y=f%x;for(;~scanf("%d%d",&x,&y);s-=f?x%f|y%f||(x+y)/f%(p/f%2*q/f%2+1):x||y);s=!printf("%d",s);}
| ^
main.c: In function ‘main’:
main.c:1:23: warning: incompatible implicit declaration of built-in function ‘scanf’ [-Wbuiltin-declaration-mismatch]
1 | s,p,q,x,y;main(f){for(scanf("%d%d%d",&p,&q,&s),y=p,f=q;x=y;f=x)y=f%x;for(;~scanf("%d%d",&x,&y);s-=f?x%f|y%f||(x+y)/f%(p/f%2*q/f%2+1):x||y);s=!printf("%d",s);}
| ^~~~~
main.c:1:1: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’
+++ |+#include <stdio.h>
1 | s,p,q,x,y;main(f){for(scanf("%d%d%d",&p,&q,&s),y=p,f=q;x=y;f=x)y=f%x;for(;~scanf("%d%d",&x,&y);s-=f?x%f|y%f||(x+y)/f%(p/f%2*q/f%2+1):x||y);s=!printf("%d",s);}
main.c:1:143: warning: incompatible implicit declaration of built-in function ‘printf’ [-Wbuiltin-declaration-mismatch]
1 | s,p,q,x,y;main(f){for(scanf("%d%d%d",&p,&q,&s),y=p,f=q;x=y;f=x)y=f%x;for(;~scanf("%d%d",&x,&y);s-=f?x%f|y%f||(x+y)/f%(p/f%2*q/f%2+1):x||y);s=!printf("%d",s);}
| ^~~~~~
main.c:1:143: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’
ソースコード
s,p,q,x,y;main(f){for(scanf("%d%d%d",&p,&q,&s),y=p,f=q;x=y;f=x)y=f%x;for(;~scanf("%d%d",&x,&y);s-=f?x%f|y%f||(x+y)/f%(p/f%2*q/f%2+1):x||y);s=!printf("%d",s);}
testestest