結果

問題 No.202 1円玉投げ
ユーザー 37zigen
提出日時 2018-05-27 20:11:52
言語 Java
(openjdk 23)
結果
TLE  
実行時間 -
コード長 742 bytes
コンパイル時間 2,641 ms
コンパイル使用メモリ 77,900 KB
実行使用メモリ 117,576 KB
最終ジャッジ日時 2024-12-22 11:03:04
合計ジャッジ時間 115,472 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 27 TLE * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.HashSet;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		new Main().run();
	}

	void run() {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] X = new int[N];
		int[] Y = new int[N];
		HashSet<Long> set = new HashSet<>();
		loop1: for (int i = 0; i < N; ++i) {
			X[i] = sc.nextInt();
			Y[i] = sc.nextInt();
			for (int x = -20 + X[i]; x <= 20 + X[i]; ++x) {
				for (int y = -20 + Y[i]; y <= 20 + Y[i]; ++y) {
					if ((x - X[i]) * (x - X[i]) + (y - Y[i]) * (y - Y[i]) >= 400)
						continue;
					if (set.contains((long) x << 32 | y)) {
						continue loop1;
					}
				}
			}
			set.add((long) X[i] << 32 | Y[i]);
		}
		System.out.println(set.size());
	}
}
0