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