結果
| 問題 |
No.202 1円玉投げ
|
| コンテスト | |
| ユーザー |
kou6839
|
| 提出日時 | 2015-05-12 01:02:38 |
| 言語 | Java (openjdk 23) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 811 bytes |
| コンパイル時間 | 2,539 ms |
| コンパイル使用メモリ | 78,700 KB |
| 実行使用メモリ | 67,296 KB |
| 最終ジャッジ日時 | 2024-12-22 08:56:10 |
| 合計ジャッジ時間 | 33,014 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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 = Integer.parseInt(sc.next());
y = Integer.parseInt(sc.next());
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);
}
}
kou6839