結果

問題 No.202 1円玉投げ
ユーザー beetbeet
提出日時 2019-04-25 18:35:20
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 1,280 ms / 5,000 ms
コード長 934 bytes
コンパイル時間 2,810 ms
コンパイル使用メモリ 229,184 KB
実行使用メモリ 9,432 KB
最終ジャッジ日時 2023-08-24 00:01:52
合計ジャッジ時間 21,961 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 995 ms
9,224 KB
testcase_01 AC 989 ms
9,432 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 64 ms
4,380 KB
testcase_06 AC 1,063 ms
8,432 KB
testcase_07 AC 1,175 ms
8,280 KB
testcase_08 AC 1,190 ms
8,280 KB
testcase_09 AC 624 ms
6,164 KB
testcase_10 AC 247 ms
4,548 KB
testcase_11 AC 510 ms
5,512 KB
testcase_12 AC 528 ms
5,840 KB
testcase_13 AC 277 ms
4,624 KB
testcase_14 AC 77 ms
4,376 KB
testcase_15 AC 607 ms
6,320 KB
testcase_16 AC 689 ms
9,060 KB
testcase_17 AC 754 ms
9,176 KB
testcase_18 AC 759 ms
9,220 KB
testcase_19 AC 565 ms
6,068 KB
testcase_20 AC 969 ms
8,472 KB
testcase_21 AC 562 ms
6,072 KB
testcase_22 AC 7 ms
4,376 KB
testcase_23 AC 7 ms
4,376 KB
testcase_24 AC 7 ms
4,380 KB
testcase_25 AC 7 ms
4,380 KB
testcase_26 AC 7 ms
4,376 KB
testcase_27 AC 7 ms
4,376 KB
testcase_28 AC 7 ms
4,376 KB
testcase_29 AC 7 ms
4,376 KB
testcase_30 AC 8 ms
4,376 KB
testcase_31 AC 6 ms
4,376 KB
testcase_32 AC 11 ms
4,380 KB
testcase_33 AC 10 ms
4,376 KB
testcase_34 AC 10 ms
4,376 KB
testcase_35 AC 773 ms
9,176 KB
testcase_36 AC 679 ms
9,112 KB
testcase_37 AC 1,280 ms
9,020 KB
testcase_38 AC 772 ms
9,224 KB
testcase_39 AC 3 ms
4,380 KB
testcase_40 AC 3 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
}
0