using System; using System.Collections.Generic; using System.Text; using System.Linq; class Program { public void Proc() { Reader.IsDebug = false; int coinCount = int.Parse(Reader.ReadLine()); List coinList = new List(); Dictionary>> dic = new Dictionary>>(); for(int i=0; ia.Key >= xKey - 20 && a.Key <= xKey + 30).ToList().ForEach((b)=>{ b.Value.Where(c=>c.Key >= yKey - 20 && c.Key <= yKey + 30).ToList().ForEach((d)=>{ d.Value.ForEach((e)=>{ if(e.IsKasanaru(newCoin)) { isKasanari = true; } }) ; }); }); if(!isKasanari) { coinList.Add(newCoin); if(!dic.ContainsKey(xKey)) { dic.Add(xKey, new Dictionary>()); } if(!dic[xKey].ContainsKey(yKey)) { dic[xKey].Add(yKey, new List()); } dic[xKey][yKey].Add(newCoin); } } Console.WriteLine(coinList.Count); } public class Ichien { public long X; public long Y; public int R = 10; public Ichien(int[] pos) { this.X = pos[0]; this.Y = pos[1]; } public bool IsKasanaru(Ichien target) { long range = ((this.X - target.X) * (this.X - target.X)) + ((this.Y - target.Y) * (this.Y - target.Y)); return (this.R + target.R) * (this.R + target.R) > range; } } public class Reader { public static bool IsDebug = true; private static String PlainInput = @" 3 0 0 15 0 30 0 "; private static System.IO.StringReader Sr = null; public static string ReadLine() { if (IsDebug) { if (Sr == null) { Sr = new System.IO.StringReader(PlainInput.Trim()); } return Sr.ReadLine(); } else { return Console.ReadLine(); } } public static int[] GetInt(char delimiter = ' ', bool trim = false) { string inptStr = ReadLine(); if (trim) { inptStr = inptStr.Trim(); } string[] inpt = inptStr.Split(delimiter); int[] ret = new int[inpt.Length]; for (int i = 0; i < inpt.Length; i++) { ret[i] = int.Parse(inpt[i]); } return ret; } } static void Main() { Program prg = new Program(); prg.Proc(); } }