結果

問題 No.202 1円玉投げ
ユーザー inu_hir0shiinu_hir0shi
提出日時 2015-05-03 23:40:49
言語 C++11
(gcc 11.4.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 2,182 bytes
コンパイル時間 1,255 ms
コンパイル使用メモリ 151,344 KB
実行使用メモリ 8,084 KB
最終ジャッジ日時 2023-08-23 21:38:03
合計ジャッジ時間 38,263 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3,643 ms
8,084 KB
testcase_01 AC 3,537 ms
8,040 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 155 ms
4,380 KB
testcase_06 AC 3,167 ms
6,884 KB
testcase_07 AC 3,630 ms
7,148 KB
testcase_08 AC 3,659 ms
7,296 KB
testcase_09 AC 1,873 ms
5,644 KB
testcase_10 AC 683 ms
4,380 KB
testcase_11 AC 1,491 ms
5,224 KB
testcase_12 AC 1,552 ms
5,268 KB
testcase_13 AC 775 ms
4,684 KB
testcase_14 AC 186 ms
4,376 KB
testcase_15 AC 1,798 ms
5,616 KB
testcase_16 TLE -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> PII;
typedef long long LL;
typedef unsigned long long ULL;
template<class T> inline bool amax (T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool amin (T &a, const T &b) { if (a > b) { a = b; return 1; } return 0; }
template<class T> ostream& operator << (ostream &os, const vector<T> &v) { os << "["; for (typename vector<T>::const_iterator it = v.begin(); it != v.end(); it++) { os << (it != v.begin() ? ", " : "") << *it; } os << "]"; return os; }
template<class T> ostream& operator << (ostream &os, const set<T> &s) { os << "["; for (typename set<T>::const_iterator it = s.begin(); it != s.end(); it++) { os << (it != s.begin() ? ", " : "") << *it; } os << "]"; return os; }
template<class Key, class Val> ostream& operator << (ostream &os, const map<Key, Val> &m) { os << "{"; for (typename map<Key, Val>::const_iterator it = m.begin(); it != m.end(); it++) { os << (it != m.begin() ? ", " : "") << it->first << ":" << it->second; } os << "}"; return os; }
template<class T, class S> ostream& operator << (ostream &os, const pair<T, S> &p) { os << "(" << p.first << ", " << p.second << ")"; return os; }
template <class Target, class Source> inline Target lexical_cast (const Source &s) { Target t; stringstream ss; ss << s; ss >> t; return t; }

//> v < ^ (clock wise)
int dx[] = {1,0,-1,0};
int dy[] = {0,1,0,-1};
const int INFI = 1<<28;
const long long int INFL = 1LL<<60;
const double INFD = 1e+300;
const float INFF = 1e+100;
const double EPS = 1e-8;


int main(){
    cout.setf(ios::fixed); cout.precision(10);
    ios_base::sync_with_stdio(false);
    int N;
    cin >> N;
    set<pair<int,int>> s;
    for (int i = 0; i < N; i++) {
        int x, y;
        cin >> x >> y;
        bool ok = true;
        for (int dx = -20; dx <= 20; dx++) {
            for (int dy = -20; dy <= 20; dy++) {
                if (sqrt(dx*dx+dy*dy) < 20) {
                    if (s.find(make_pair(x+dx, y+dy)) != s.end()) ok = false;
                }
            }
        }
        if (ok) s.insert(pair<int,int>(x, y));
    }
    cout << s.size() << endl;
    return 0;
}
0