結果

問題 No.202 1円玉投げ
コンテスト
ユーザー kou6839
提出日時 2015-05-12 01:55:44
言語 Java
(openjdk 25.0.2)
コンパイル:
javac -encoding UTF8 _filename_
実行:
java -ea -Xmx700m -Xss256M -DONLINE_JUDGE=true _class_
結果
TLE  
実行時間 -
コード長 882 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,463 ms
コンパイル使用メモリ 83,868 KB
実行使用メモリ 74,828 KB
最終ジャッジ日時 2026-05-28 16:47:07
合計ジャッジ時間 17,025 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample -- * 3
other TLE * 1 -- * 37
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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)&&check;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);
	}
}
0