結果
| 問題 |
No.202 1円玉投げ
|
| コンテスト | |
| ユーザー |
kou6839
|
| 提出日時 | 2015-05-12 01:55:44 |
| 言語 | Java (openjdk 23) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 882 bytes |
| コンパイル時間 | 2,822 ms |
| コンパイル使用メモリ | 78,492 KB |
| 実行使用メモリ | 140,388 KB |
| 最終ジャッジ日時 | 2024-12-22 08:57:51 |
| 合計ジャッジ時間 | 99,671 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 7 WA * 18 TLE * 13 |
ソースコード
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 []x = new int[100020];
int []y = new int[100020];
int ans=0;
for(int i=0;i<n;i++){
boolean check = true;
x[i] = Integer.parseInt(sc.next());
y[i] = Integer.parseInt(sc.next());
for(int xx=Math.max(0, x[i]-19);xx<=Math.min(20000, x[i]+19)&✓xx++){
int dy = (int) Math.sqrt(399-(i-xx)*(i-xx));
for(int yy=Math.max(0, y[i]-dy);yy<=Math.min(20000, y[i]+dy);yy++){
if(xSet.contains(xx)&&ySet.contains(yy)) check=false;
}
}
if(check){
ans++;
xSet.add(x[i]);
ySet.add(y[i]);
}
}
System.out.println(ans);
}
}
kou6839