//xでソート。 #include #include #include #include #include using namespace std; //重なったら1 そうでなければ0 int check(int loc1x, int loc1y, int loc2x, int loc2y){ int kyori = pow(loc2x - loc1x, 2) + pow(loc2y - loc1y, 2); //cout << "距離測定:" << loc1[0] << "," << loc1[0] << "と" << loc2[0] << "," << loc2[1] << ":" << kyori << endl; if(kyori < 400 && kyori > -400){ return 1; } return 0; } int main(){ int max; int count = 0; int loc[100000][2]; int in1; int in2; int s1; int start; int end; int s2; cin >> max; for(int i=0; i> in1; cin >> in2; //挿入ソート(昇順) s1 = 0; while(in1 < loc[s1][0] && s1 < count){ s1 ++; } //s1が挿入先 for(s2=count; s2>=s1; s2--){ loc[s2 + 1][0] = loc[s2][0]; loc[s2 + 1][1] = loc[s2][1]; } //データ挿入 loc[s2][0] = in1; loc[s2][1] = in2; //カウント部分 start = s2 - 100; if(start < 0){ start = 0; } end = s2 + 100; if(end > count){ end = count; } for(int i2=start; i2