結果

問題 No.202 1円玉投げ
ユーザー tubo28tubo28
提出日時 2015-05-03 23:34:17
言語 C++11
(gcc 11.4.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 1,759 bytes
コンパイル時間 520 ms
コンパイル使用メモリ 73,260 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-23 21:34:16
合計ジャッジ時間 75,249 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 TLE -
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 23 ms
4,376 KB
testcase_06 AC 3,091 ms
4,384 KB
testcase_07 AC 3,827 ms
4,376 KB
testcase_08 AC 3,896 ms
4,376 KB
testcase_09 AC 1,317 ms
4,376 KB
testcase_10 AC 252 ms
4,376 KB
testcase_11 AC 909 ms
4,380 KB
testcase_12 AC 961 ms
4,380 KB
testcase_13 AC 308 ms
4,380 KB
testcase_14 AC 31 ms
4,376 KB
testcase_15 AC 1,234 ms
4,380 KB
testcase_16 TLE -
testcase_17 TLE -
testcase_18 TLE -
testcase_19 AC 1,094 ms
4,380 KB
testcase_20 AC 2,553 ms
4,376 KB
testcase_21 AC 1,067 ms
4,376 KB
testcase_22 AC 3 ms
4,380 KB
testcase_23 AC 3 ms
4,380 KB
testcase_24 AC 2 ms
4,380 KB
testcase_25 AC 2 ms
4,380 KB
testcase_26 AC 3 ms
4,380 KB
testcase_27 AC 3 ms
4,376 KB
testcase_28 AC 2 ms
4,376 KB
testcase_29 AC 2 ms
4,384 KB
testcase_30 AC 2 ms
4,376 KB
testcase_31 AC 2 ms
4,380 KB
testcase_32 AC 3 ms
4,376 KB
testcase_33 AC 2 ms
4,376 KB
testcase_34 AC 2 ms
4,376 KB
testcase_35 TLE -
testcase_36 TLE -
testcase_37 AC 4,347 ms
4,376 KB
testcase_38 TLE -
testcase_39 AC 1 ms
4,380 KB
testcase_40 AC 2 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <cstdio>
#include <cstring>
#include <cmath>
using namespace std;
#define loop(i,a,b) for(int i=(a);i<int(b);i++)
#define rep(i,b) loop(i,0,b)
#define all(c) (c).begin(), (c).end()
typedef long long ll;
typedef unsigned long long ull;

//#define int ll
//#define endl "\n"

template<typename Type, unsigned N, unsigned Last>
struct tuple_printer
{
    static void print(std::ostream& out, const Type& value)
    {
        out << std::get<N>(value) << ", ";
        tuple_printer<Type, N + 1, Last>::print(out, value);
    }
};
template<typename Type, unsigned N>
struct tuple_printer < Type, N, N >
{
    static void print(std::ostream& out, const Type& value)
    {
        out << std::get<N>(value);
    }
};
template<typename... Types>
std::ostream& operator<<(std::ostream& out, const std::tuple<Types...>& value)
{
    out << "(";
    tuple_printer<std::tuple<Types...>, 0, sizeof...(Types)-1>::print(out, value);
    out << ")";
    return out;
}

#ifdef DEBUG
#define dump(...) (cerr << #__VA_ARGS__ << " = " << make_tuple(__VA_ARGS__) << " [" << __LINE__ << "]" << endl)
#else
#define dump(...)
#endif

int main(){
    int n;
    cin >> n;
    vector<pair<int, int>> cur;
    rep(i, n){
        int x, y;
        cin >> x >> y;
        auto put = make_pair(x, y);
        bool hit = false;
        for (auto & p : cur){
            int dx = p.first - x;
            int dy = p.second - y;
            dump(dx, dy);
            if (dx*dx + dy*dy >= 400) continue;
            hit = true;
            break;
        }
        dump(hit);
        if (!hit){
            cur.push_back(put);
        }
    }
    cout << cur.size() << endl;
}
0