結果
| 問題 |
No.202 1円玉投げ
|
| コンテスト | |
| ユーザー |
Twizz
|
| 提出日時 | 2017-06-06 20:23:06 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 270 ms / 5,000 ms |
| コード長 | 819 bytes |
| コンパイル時間 | 1,534 ms |
| コンパイル使用メモリ | 161,824 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-12-22 10:59:03 |
| 合計ジャッジ時間 | 5,459 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 38 |
ソースコード
#include"bits/stdc++.h"
//#include<bits/stdc++.h>
using namespace std;
#define print(x) cout<<x<<endl;
#define rep(i,a,b) for(int i=a;i<b;i++)
#define REP(i,a) for(int i=0;i<a;i++)
typedef long long ll;
typedef pair<int, int> PI;
typedef pair<int, PI> V;
typedef vector<int> VE;
const ll mod = 100000000000;
int n, x[100002], y[100002];
bool now[100002];
VE center[20100];
int main() {
cin >> n;
bool flag = 1;
int count = 0;
REP(i, n)cin >> x[i] >> y[i];
REP(i, n) {
int xl = max(0, x[i] - 20);
int xr = x[i] + 20;
flag = 1;
for (int nx = xl; nx <= xr; nx++) {
for (auto ny : center[nx]) {
ll dist = pow(x[i] - nx, 2) + pow(y[i] - ny, 2);
if (dist < 400) {
flag = 0;
break;
}
}
}
if (flag) {
count++;
center[x[i]].push_back(y[i]);
}
}
print(count);
return 0;
}
Twizz