結果
問題 |
No.202 1円玉投げ
|
ユーザー |
![]() |
提出日時 | 2015-05-12 00:53:49 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 786 bytes |
コンパイル時間 | 2,205 ms |
コンパイル使用メモリ | 78,428 KB |
実行使用メモリ | 69,908 KB |
最終ジャッジ日時 | 2024-12-22 08:55:32 |
合計ジャッジ時間 | 36,070 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 11 WA * 27 |
ソースコード
import java.io.File; import java.util.*; public class Main { public static void main(String[] args){ // TODO 自動生成されたメソッド・スタブ Scanner sc = new Scanner(System.in); int n = sc.nextInt(); HashSet<Integer> xSet = new HashSet<>(); HashSet<Integer> ySet = new HashSet<>(); int ans=0; int x,y; for(int k=0;k<n;k++){ boolean check = true; x = sc.nextInt(); y = sc.nextInt(); for(int i=Math.max(0, x-19);(i<=Math.min(20000, x+19)&&check);i++){ int dy = (int) Math.sqrt(399-(i-x)*(i-x)+0.0001); for(int j=Math.max(0, y-dy);j<=Math.min(20000, y+dy);j++){ if(xSet.contains(i)&&ySet.contains(j)) check=false; } } if(check){ ans++; xSet.add(x); ySet.add(y); } } System.out.println(ans); } }