結果
| 問題 |
No.202 1円玉投げ
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-10-19 10:41:13 |
| 言語 | D (dmd 2.109.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 684 bytes |
| コンパイル時間 | 765 ms |
| コンパイル使用メモリ | 102,528 KB |
| 実行使用メモリ | 20,420 KB |
| 最終ジャッジ日時 | 2024-06-12 04:38:11 |
| 合計ジャッジ時間 | 13,517 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | -- * 3 |
| other | TLE * 1 -- * 37 |
ソースコード
import std.stdio;
import std.array;
import std.string;
import std.conv;
import std.algorithm;
import std.typecons;
import std.range;
void main() {
int N = readln().chomp.to!int;
bool[Tuple!(int, int)] s;
int ans = 0;
Tuple!(int, int)[] shuuhen;
foreach (i; iota(-20, 21))
foreach (j; iota(-20, 21))
if (i*i + j*j < 400)
shuuhen ~= tuple(i, j);
foreach (i; iota(N)) {
auto input = readln().split.map!(to!int);
int x = input[0];
int y = input[1];
bool ok = true;
foreach (t; shuuhen)
if (tuple(x+t[0], y+t[1]) in s) {
ok = false;
break;
}
if (ok) {
s[tuple(x, y)] = true;
ans += 1;
}
}
writeln(ans);
}