結果
問題 | No.202 1円玉投げ |
ユーザー | 37zigen |
提出日時 | 2018-05-27 20:14:16 |
言語 | Java21 (openjdk 21) |
結果 |
AC
|
実行時間 | 4,323 ms / 5,000 ms |
コード長 | 2,853 bytes |
コンパイル時間 | 2,601 ms |
コンパイル使用メモリ | 77,872 KB |
実行使用メモリ | 70,952 KB |
最終ジャッジ日時 | 2024-06-10 03:28:52 |
合計ジャッジ時間 | 73,803 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 3,973 ms
69,368 KB |
testcase_01 | AC | 4,323 ms
62,988 KB |
testcase_02 | AC | 51 ms
49,712 KB |
testcase_03 | AC | 50 ms
49,848 KB |
testcase_04 | AC | 50 ms
49,800 KB |
testcase_05 | AC | 420 ms
58,288 KB |
testcase_06 | AC | 3,738 ms
62,988 KB |
testcase_07 | AC | 4,004 ms
66,820 KB |
testcase_08 | AC | 4,211 ms
65,332 KB |
testcase_09 | AC | 2,258 ms
62,644 KB |
testcase_10 | AC | 827 ms
58,176 KB |
testcase_11 | AC | 1,622 ms
61,008 KB |
testcase_12 | AC | 1,827 ms
62,432 KB |
testcase_13 | AC | 954 ms
58,520 KB |
testcase_14 | AC | 421 ms
57,780 KB |
testcase_15 | AC | 2,116 ms
60,872 KB |
testcase_16 | AC | 3,618 ms
69,124 KB |
testcase_17 | AC | 3,629 ms
68,948 KB |
testcase_18 | AC | 3,473 ms
70,952 KB |
testcase_19 | AC | 1,890 ms
61,368 KB |
testcase_20 | AC | 3,132 ms
64,412 KB |
testcase_21 | AC | 2,002 ms
61,320 KB |
testcase_22 | AC | 118 ms
54,440 KB |
testcase_23 | AC | 129 ms
54,912 KB |
testcase_24 | AC | 102 ms
54,268 KB |
testcase_25 | AC | 124 ms
54,452 KB |
testcase_26 | AC | 119 ms
54,356 KB |
testcase_27 | AC | 128 ms
54,916 KB |
testcase_28 | AC | 120 ms
54,796 KB |
testcase_29 | AC | 110 ms
54,608 KB |
testcase_30 | AC | 163 ms
55,492 KB |
testcase_31 | AC | 103 ms
54,060 KB |
testcase_32 | AC | 199 ms
55,224 KB |
testcase_33 | AC | 151 ms
54,588 KB |
testcase_34 | AC | 197 ms
56,184 KB |
testcase_35 | AC | 3,057 ms
70,312 KB |
testcase_36 | AC | 3,768 ms
69,088 KB |
testcase_37 | AC | 4,276 ms
66,476 KB |
testcase_38 | AC | 3,280 ms
70,148 KB |
testcase_39 | AC | 104 ms
54,568 KB |
testcase_40 | AC | 94 ms
54,168 KB |
ソースコード
import java.io.IOException; import java.io.InputStream; import java.util.HashSet; import java.util.NoSuchElementException; import java.util.Scanner; public class Main { public static void main(String[] args) { new Main().run(); } void run() { FastScanner sc = new FastScanner(); 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()); } class FastScanner { private final InputStream in = System.in; private final byte[] buffer = new byte[1024]; private int ptr = 0; private int buflen = 0; private boolean hasNextByte() { if (ptr < buflen) { return true; }else{ ptr = 0; try { buflen = in.read(buffer); } catch (IOException e) { e.printStackTrace(); } if (buflen <= 0) { return false; } } return true; } private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;} private boolean isPrintableChar(int c) { return 33 <= c && c <= 126;} private void skipUnprintable() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;} public boolean hasNext() { skipUnprintable(); return hasNextByte();} public String next() { if (!hasNext()) throw new NoSuchElementException(); StringBuilder sb = new StringBuilder(); int b = readByte(); while(isPrintableChar(b)) { sb.appendCodePoint(b); b = readByte(); } return sb.toString(); } public long nextLong() { if (!hasNext()) throw new NoSuchElementException(); long n = 0; boolean minus = false; int b = readByte(); if (b == '-') { minus = true; b = readByte(); } if (b < '0' || '9' < b) { throw new NumberFormatException(); } while(true){ if ('0' <= b && b <= '9') { n *= 10; n += b - '0'; }else if(b == -1 || !isPrintableChar(b)){ return minus ? -n : n; }else{ throw new NumberFormatException(); } b = readByte(); } } public int nextInt() { return (int)nextLong(); } } }