結果
問題 | No.202 1円玉投げ |
ユーザー |
![]() |
提出日時 | 2018-05-31 19:28:05 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 774 ms / 5,000 ms |
コード長 | 1,029 bytes |
コンパイル時間 | 2,034 ms |
コンパイル使用メモリ | 176,136 KB |
実行使用メモリ | 9,600 KB |
最終ジャッジ日時 | 2024-12-22 11:17:25 |
合計ジャッジ時間 | 12,047 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 38 |
コンパイルメッセージ
main.cpp:8:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 8 | main(){ | ^~~~
ソースコード
#include<bits/stdc++.h> #define rep(i, n) for(int i = 0; i < (int)(n); i++) using namespace std; typedef long long ll; typedef pair<int,int> P; int INF = (1LL << 30) - 1; int MOD = 1e9+7; main(){ int N; cin >> N; vector< P > V(N); vector<set<int> > X(20010); rep(i,N){ int a,b; cin >> a >> b; V[i] = P(a,b); } int cnt = 0; rep(i,N){ auto p = V[i]; int x = p.first, y = p.second; bool ok = 1; //(x,y)との距離の2乗が400未満となる点を探す for(int j = max(0,x-20);j <= x+20;j++){ for(int k = max(0,y-20);k <= y+20;k++){ ll r = (x - j) * (x - j) + (y - k) * (y - k); //cout << j << " " << k << endl; if(X[j].count(k) && r < 400){ ok = 0; j = x+20; break; } } } if(ok){ X[x].insert(y); cnt++; } } cout << cnt << endl; }