結果
| 問題 |
No.61 リベリオン
|
| コンテスト | |
| ユーザー |
👑 testestest
|
| 提出日時 | 2016-07-30 09:41:06 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 338 bytes |
| コンパイル時間 | 685 ms |
| コンパイル使用メモリ | 20,736 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-11-06 20:20:05 |
| 合計ジャッジ時間 | 2,966 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 2 WA * 2 |
コンパイルメッセージ
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:1:1: warning: type defaults to ‘int’ in declaration of ‘w’ [-Wimplicit-int]
main.c:1:3: warning: type defaults to ‘int’ in declaration of ‘h’ [-Wimplicit-int]
1 | w,h,mx,my,hx,hy,vx,vy,d,g,i;
| ^
main.c:1:5: warning: type defaults to ‘int’ in declaration of ‘mx’ [-Wimplicit-int]
1 | w,h,mx,my,hx,hy,vx,vy,d,g,i;
| ^~
main.c:1:8: warning: type defaults to ‘int’ in declaration of ‘my’ [-Wimplicit-int]
1 | w,h,mx,my,hx,hy,vx,vy,d,g,i;
| ^~
main.c:1:11: warning: type defaults to ‘int’ in declaration of ‘hx’ [-Wimplicit-int]
1 | w,h,mx,my,hx,hy,vx,vy,d,g,i;
| ^~
main.c:1:14: warning: type defaults to ‘int’ in declaration of ‘hy’ [-Wimplicit-int]
1 | w,h,mx,my,hx,hy,vx,vy,d,g,i;
| ^~
main.c:1:17: warning: type defaults to ‘int’ in declaration of ‘vx’ [-Wimplicit-int]
1 | w,h,mx,my,hx,hy,vx,vy,d,g,i;
| ^~
main.c:1:20: warning: type defaults to ‘int’ in declaration of ‘vy’ [-Wimplicit-int]
1 | w,h,mx,my,hx,hy,vx,vy,d,g,i;
| ^~
main.c:1:23: warning: type defaults to ‘int’ in declaration of ‘d’ [-Wimplicit-int]
1 | w,h,mx,my,hx,hy,vx,vy,d,g,i;
| ^
main.c:1:25: warning: type defaults to ‘int’ in declaration of ‘g’ [-Wimplicit-int]
1 | w,h,mx,my,hx,hy,vx,vy,d,g,i;
| ^
main.c:1:27: warning: type defaults to ‘int’ in declaration of ‘i’ [-Wimplicit-int]
1 | w,h,mx,my,hx,hy,vx,vy,d,g,i;
| ^
main.c:2:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
2 | check(x,y){x%=2*w;y%=2*h;return (x==mx)|(2*w-x==mx)&&(y==my)|(2*h-y==my);}
| ^~~~~
main.c: In function ‘check’:
main.c:2:1: warning: type of ‘x’ defaults to ‘
ソースコード
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