結果
| 問題 |
No.202 1円玉投げ
|
| コンテスト | |
| ユーザー |
beet
|
| 提出日時 | 2019-04-25 18:35:20 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 1,430 ms / 5,000 ms |
| コード長 | 934 bytes |
| コンパイル時間 | 2,743 ms |
| コンパイル使用メモリ | 224,784 KB |
| 最終ジャッジ日時 | 2025-01-07 02:57:29 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 38 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
using Int = long long;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
template<typename T,typename U>
using gmap = cc_hash_table<T, U, hash<T> >;
//INSERT ABOVE HERE
signed main(){
Int n;
cin>>n;
auto calc=[&](Int x,Int y){return (x+1000)*30000+(y+1000);};
gmap<Int, Int> sp;
using P = pair<Int, Int>;
vector<P> dz;
for(Int i=-100;i<=100;i++)
for(Int j=-100;j<=100;j++)
if(i*i+j*j<400) dz.emplace_back(i,j);
Int cnt=0;
for(Int i=0;i<n;i++){
Int x,y;
cin>>x>>y;
Int flg=0;
for(auto p:dz)
flg|=sp.find(calc(x+p.first,y+p.second))!=sp.end();
if(flg) continue;
cnt++;
sp[calc(x,y)]=1;
}
cout<<cnt<<endl;
return 0;
}
beet