結果

問題 No.202 1円玉投げ
ユーザー beetbeet
提出日時 2019-04-25 18:05:28
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 780 bytes
コンパイル時間 2,097 ms
コンパイル使用メモリ 207,484 KB
実行使用メモリ 8,056 KB
最終ジャッジ日時 2023-08-24 00:03:44
合計ジャッジ時間 72,599 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3,639 ms
7,932 KB
testcase_01 AC 4,372 ms
7,784 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 222 ms
4,376 KB
testcase_06 AC 4,048 ms
5,872 KB
testcase_07 AC 4,766 ms
6,148 KB
testcase_08 AC 4,801 ms
6,364 KB
testcase_09 AC 2,392 ms
5,460 KB
testcase_10 AC 923 ms
4,380 KB
testcase_11 AC 1,933 ms
4,804 KB
testcase_12 AC 2,017 ms
4,748 KB
testcase_13 AC 1,018 ms
4,464 KB
testcase_14 AC 262 ms
4,380 KB
testcase_15 AC 2,286 ms
5,572 KB
testcase_16 AC 3,133 ms
8,056 KB
testcase_17 AC 3,167 ms
7,784 KB
testcase_18 AC 3,158 ms
7,948 KB
testcase_19 AC 2,150 ms
5,612 KB
testcase_20 AC 3,534 ms
5,748 KB
testcase_21 AC 2,137 ms
5,460 KB
testcase_22 AC 25 ms
4,380 KB
testcase_23 AC 26 ms
4,376 KB
testcase_24 AC 24 ms
4,380 KB
testcase_25 AC 25 ms
4,376 KB
testcase_26 AC 26 ms
4,380 KB
testcase_27 AC 26 ms
4,376 KB
testcase_28 AC 25 ms
4,376 KB
testcase_29 AC 25 ms
4,376 KB
testcase_30 AC 27 ms
4,380 KB
testcase_31 AC 16 ms
4,376 KB
testcase_32 AC 32 ms
4,376 KB
testcase_33 AC 29 ms
4,380 KB
testcase_34 AC 31 ms
4,380 KB
testcase_35 AC 3,124 ms
7,780 KB
testcase_36 AC 3,045 ms
7,956 KB
testcase_37 TLE -
testcase_38 AC 3,106 ms
7,936 KB
testcase_39 AC 8 ms
4,376 KB
testcase_40 AC 7 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;}


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