結果
問題 | No.202 1円玉投げ |
ユーザー |
![]() |
提出日時 | 2019-04-25 18:05:28 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 780 bytes |
コンパイル時間 | 2,282 ms |
コンパイル使用メモリ | 201,936 KB |
最終ジャッジ日時 | 2025-01-07 02:57:03 |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 35 TLE * 3 |
ソースコード
#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;} //INSERT ABOVE HERE signed main(){ Int n; cin>>n; auto calc=[&](Int x,Int y){return (x+1000)*30000+(y+1000);}; unordered_set<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.count(calc(x+p.first,y+p.second)); if(flg) continue; cnt++; sp.emplace(calc(x,y)); } cout<<cnt<<endl; return 0; }