結果

問題 No.202 1円玉投げ
ユーザー kou6839kou6839
提出日時 2015-05-12 02:08:17
言語 Java19
(openjdk 21)
結果
AC  
実行時間 2,975 ms / 5,000 ms
コード長 1,123 bytes
コンパイル時間 2,083 ms
コンパイル使用メモリ 75,748 KB
実行使用メモリ 75,696 KB
最終ジャッジ日時 2023-08-23 22:47:29
合計ジャッジ時間 43,742 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 931 ms
70,100 KB
testcase_01 AC 2,160 ms
72,652 KB
testcase_02 AC 122 ms
55,892 KB
testcase_03 AC 126 ms
55,808 KB
testcase_04 AC 122 ms
55,796 KB
testcase_05 AC 410 ms
62,184 KB
testcase_06 AC 2,697 ms
74,040 KB
testcase_07 AC 2,931 ms
75,696 KB
testcase_08 AC 2,975 ms
74,140 KB
testcase_09 AC 1,743 ms
71,956 KB
testcase_10 AC 1,176 ms
69,928 KB
testcase_11 AC 1,511 ms
70,360 KB
testcase_12 AC 1,418 ms
70,996 KB
testcase_13 AC 1,117 ms
70,036 KB
testcase_14 AC 429 ms
62,096 KB
testcase_15 AC 1,380 ms
71,308 KB
testcase_16 AC 1,012 ms
66,576 KB
testcase_17 AC 1,155 ms
69,524 KB
testcase_18 AC 1,155 ms
69,832 KB
testcase_19 AC 1,492 ms
71,936 KB
testcase_20 AC 2,174 ms
73,884 KB
testcase_21 AC 1,503 ms
71,996 KB
testcase_22 AC 192 ms
56,452 KB
testcase_23 AC 195 ms
56,332 KB
testcase_24 AC 197 ms
56,752 KB
testcase_25 AC 196 ms
56,404 KB
testcase_26 AC 198 ms
58,960 KB
testcase_27 AC 197 ms
58,676 KB
testcase_28 AC 199 ms
59,700 KB
testcase_29 AC 196 ms
56,900 KB
testcase_30 AC 203 ms
59,340 KB
testcase_31 AC 193 ms
56,812 KB
testcase_32 AC 215 ms
58,668 KB
testcase_33 AC 218 ms
59,672 KB
testcase_34 AC 201 ms
58,932 KB
testcase_35 AC 1,060 ms
66,680 KB
testcase_36 AC 1,060 ms
74,004 KB
testcase_37 AC 2,951 ms
73,940 KB
testcase_38 AC 1,110 ms
69,764 KB
testcase_39 AC 172 ms
56,508 KB
testcase_40 AC 179 ms
56,756 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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<>();
        HashSet<Integer>[] sets = new HashSet[20200];
        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(sets[i]!=null && sets[i].contains(j)) check=false;
                }
            }
            if(check){
                ans++;
                if(sets[x]==null) sets[x]=new HashSet<>();
                sets[x].add(y);
                }
        }
        System.out.println(ans);
    }
}
0