結果
| 問題 | 
                            No.202 1円玉投げ
                             | 
                    
| コンテスト | |
| ユーザー | 
                             srjywrdnprkt
                         | 
                    
| 提出日時 | 2022-12-23 05:36:17 | 
| 言語 | C++17(clang)  (17.0.6 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                TLE
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 813 bytes | 
| コンパイル時間 | 2,030 ms | 
| コンパイル使用メモリ | 146,792 KB | 
| 実行使用メモリ | 12,160 KB | 
| 最終ジャッジ日時 | 2024-11-18 03:56:16 | 
| 合計ジャッジ時間 | 71,905 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge3 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 37 TLE * 1 | 
ソースコード
#include <iostream>
#include <vector>
#include <cmath>
#include <map>
#include <set>
#include <iomanip>
#include <queue>
#include <algorithm>
#include <numeric>
#include <deque>
#include <complex>
using namespace std;
int main(){
    vector<pair<long long, long long>> d;
    for (int i=-20; i<=20; i++){
        for (int j=-20; j<=20; j++) if (i*i+j*j<400) d.push_back({i, j});
    }
    long long N, X, Y, ans=0;
    cin >> N;
    set<pair<long long, long long>> st;
    for (int i=0; i<N; i++){
        cin >> X >> Y;
        bool f=1;
        for (auto [dx, dy] : d){
            if (st.count({X+dx, Y+dy})){
                f = 0;
                break;
            }
        }
        if (f){
            ans++;
            st.insert({X, Y});
        }
    }
    cout << ans << endl;
    return 0;
}
            
            
            
        
            
srjywrdnprkt