結果
問題 |
No.202 1円玉投げ
|
ユーザー |
|
提出日時 | 2016-10-19 10:46:35 |
言語 | D (dmd 2.109.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 698 bytes |
コンパイル時間 | 1,078 ms |
コンパイル使用メモリ | 102,592 KB |
実行使用メモリ | 30,172 KB |
最終ジャッジ日時 | 2024-06-12 04:38:31 |
合計ジャッジ時間 | 13,056 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 3 |
other | AC * 1 TLE * 1 -- * 36 |
ソースコード
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[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 (x+t[0] in s && y+t[1] in s[x+t[0]]) { ok = false; break; } if (ok) { s[x][y] = true; ans += 1; } } writeln(ans); }