結果

問題 No.202 1円玉投げ
ユーザー nebukuro09nebukuro09
提出日時 2016-11-16 20:25:23
言語 D
(dmd 2.106.1)
結果
AC  
実行時間 1,010 ms / 5,000 ms
コード長 857 bytes
コンパイル時間 816 ms
コンパイル使用メモリ 99,408 KB
実行使用メモリ 406,236 KB
最終ジャッジ日時 2023-09-02 22:55:35
合計ジャッジ時間 20,513 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 685 ms
405,036 KB
testcase_01 AC 1,010 ms
404,692 KB
testcase_02 AC 121 ms
403,668 KB
testcase_03 AC 120 ms
403,784 KB
testcase_04 AC 123 ms
403,980 KB
testcase_05 AC 177 ms
405,512 KB
testcase_06 AC 823 ms
405,652 KB
testcase_07 AC 930 ms
405,984 KB
testcase_08 AC 928 ms
404,404 KB
testcase_09 AC 576 ms
404,936 KB
testcase_10 AC 318 ms
405,296 KB
testcase_11 AC 494 ms
405,968 KB
testcase_12 AC 509 ms
404,984 KB
testcase_13 AC 339 ms
404,816 KB
testcase_14 AC 186 ms
405,000 KB
testcase_15 AC 565 ms
405,496 KB
testcase_16 AC 579 ms
405,236 KB
testcase_17 AC 674 ms
406,236 KB
testcase_18 AC 669 ms
404,756 KB
testcase_19 AC 533 ms
405,020 KB
testcase_20 AC 766 ms
404,648 KB
testcase_21 AC 537 ms
405,656 KB
testcase_22 AC 126 ms
404,524 KB
testcase_23 AC 126 ms
403,672 KB
testcase_24 AC 122 ms
405,140 KB
testcase_25 AC 122 ms
404,716 KB
testcase_26 AC 123 ms
403,688 KB
testcase_27 AC 124 ms
404,456 KB
testcase_28 AC 126 ms
404,208 KB
testcase_29 AC 123 ms
404,676 KB
testcase_30 AC 128 ms
404,392 KB
testcase_31 AC 124 ms
404,208 KB
testcase_32 AC 131 ms
404,464 KB
testcase_33 AC 126 ms
403,852 KB
testcase_34 AC 127 ms
403,928 KB
testcase_35 AC 663 ms
405,276 KB
testcase_36 AC 816 ms
404,988 KB
testcase_37 AC 984 ms
405,988 KB
testcase_38 AC 677 ms
405,756 KB
testcase_39 AC 122 ms
403,972 KB
testcase_40 AC 121 ms
404,648 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import std.stdio;
import std.array;
import std.string;
import std.conv;
import std.algorithm;
import std.typecons;
import std.range;
import std.random;
import std.math;
import std.container;

void main() {
  auto N = readln.chomp.to!int;

  alias Tuple!(int, "x", int, "y") point;
  point[] check;
  foreach (x; iota(-20, 21))
    foreach (y; iota(-20, 21))
      if (x*x+y*y < 400)
	check ~= point(x, y);

  auto mem = new bool[][](20001, 20001);
  int ans = 0;

  foreach (i; 0..N) {
    auto input = readln.split.map!(to!int);
    auto x = input[0];
    auto y = input[1];
    bool flag = true;
    foreach (p; check) {
      if (x+p.x < 0 || x+p.x >= 20001 || y+p.y < 0 || y+p.y >= 20001)
	continue;
      if (mem[x+p.x][y+p.y]) {
	flag = false;
	break;
      }
    }
    if (flag) {
      ans += 1;
      mem[x][y] = true;
    }
  }

  writeln(ans);
}
0