結果
| 問題 | No.61 リベリオン |
| コンテスト | |
| ユーザー |
testestest
|
| 提出日時 | 2016-07-30 09:41:06 |
| 言語 | C90 (gcc 12.4.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 338 bytes |
| 記録 | |
| コンパイル時間 | 208 ms |
| コンパイル使用メモリ | 30,664 KB |
| 最終ジャッジ日時 | 2026-02-23 22:10:20 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | RE * 2 |
| other | RE * 4 |
コンパイルメッセージ
main.c:1:1: warning: data definition has no type or storage class
1 | w,h,mx,my,hx,hy,vx,vy,d,g,i;
| ^
main.c: In function ‘main’:
main.c:6:15: warning: incompatible implicit declaration of built-in function ‘scanf’ [-Wbuiltin-declaration-mismatch]
6 | for(;~scanf("%d%d%d%d%d%d%d%d%d",&w,&h,&d,&mx,&my,&hx,&hy,&vx,&vy);){
| ^~~~~
main.c:1:1: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’
+++ |+#include <stdio.h>
1 | w,h,mx,my,hx,hy,vx,vy,d,g,i;
/usr/bin/ld: /tmp/ccBicXTV.o: in function `main':
main.c:(.text.startup+0x38): 警告: the `gets' function is dangerous and should not be used.
ソースコード
w,h,mx,my,hx,hy,vx,vy,d,g,i;
check(x,y){x%=2*w;y%=2*h;return (x==mx)|(2*w-x==mx)&&(y==my)|(2*h-y==my);}
gcd(p,q){return q?gcd(q,p%q):p;}
main(){
gets(&i);
for(;~scanf("%d%d%d%d%d%d%d%d%d",&w,&h,&d,&mx,&my,&hx,&hy,&vx,&vy);){
g=abs(gcd(vx,vy));
for(i=0;i<2e4&&!check(hx+vx/g*i,hy+vy/g*i);i++);
puts(i>d*g|i==2e4?"Miss":"Hit");
}
}
testestest