結果
問題 |
No.202 1円玉投げ
|
ユーザー |
![]() |
提出日時 | 2015-05-12 00:41:01 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 783 bytes |
コンパイル時間 | 2,228 ms |
コンパイル使用メモリ | 78,860 KB |
実行使用メモリ | 68,536 KB |
最終ジャッジ日時 | 2024-12-22 08:53:24 |
合計ジャッジ時間 | 21,554 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 8 WA * 30 |
ソースコード
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(2000, x+19)&&check);i++){ int dy = (int) Math.sqrt(399-(i-x)*(i-x)+0.001); for(int j=Math.max(0, y-dy);j<=Math.min(2000, 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); } }