結果
問題 |
No.61 リベリオン
|
ユーザー |
![]() |
提出日時 | 2014-11-10 00:52:01 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,812 bytes |
コンパイル時間 | 3,194 ms |
コンパイル使用メモリ | 116,976 KB |
実行使用メモリ | 49,460 KB |
最終ジャッジ日時 | 2024-12-31 09:16:00 |
合計ジャッジ時間 | 6,303 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 WA * 1 |
other | AC * 1 WA * 3 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System; using System.Collections; using System.Collections.Generic; class TEST{ static void Main(){ Sol mySol =new Sol(); mySol.Solve(); } } class Sol{ public void Solve(){ for(int q=0;q<Q;q++){ Solve2(ria()); } } int Q; public Sol(){ Q=ri(); } void Solve2(int[] d){ int W,H,D,Mx,My,Hx,Hy,Vx,Vy; W=d[0];H=d[1];D=d[2]; Mx=d[3];My=d[4];Hx=d[5];Hy=d[6]; Vx=d[7];Vy=d[8]; if(Vx<0){ Vx*=-1; Mx=W-Mx; Hx=W=Hx; } if(Vy<0){ Vy*=-1; My=H-My; Hy=H-Hy; } List<int> XX=new List<int>(); List<int> YY=new List<int>(); for(int i=0;i<H*W+1;i++){ for(int j=0;j<W*H+1;j++){ int x=j*W; if(j%2==0)x+=Mx; if(j%2!=0)x+=W-Mx; int y=i*H; if(i%2==0)y+=My; if(i%2!=0)y+=H-My; XX.Add(x); YY.Add(y); } } bool chk=false; int C=XX.Count; for(int i=0;i<C;i++){ //Console.WriteLine("{0} {1}:Vx={2},Vy={3},diffX={4},diffY={5}",XX[i],YY[i],Vx,Vy,XX[i]-Hx,YY[i]-Hy); if(Vx*(YY[i]-Hy)==Vy*(XX[i]-Hx)){ double T=(double)(XX[i]-Hx)/(double)(Vx); if((double)D>T){ chk=true; } } } Console.WriteLine(chk?"Hit":"Miss"); } static String rs(){return Console.ReadLine();} static int ri(){return int.Parse(Console.ReadLine());} static long rl(){return long.Parse(Console.ReadLine());} static double rd(){return double.Parse(Console.ReadLine());} static String[] rsa(){return Console.ReadLine().Split(' ');} static int[] ria(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>int.Parse(e));} static long[] rla(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>long.Parse(e));} static double[] rda(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>double.Parse(e));} }