結果

問題 No.2602 Real Collider
ユーザー Jeroen Op de BeekJeroen Op de Beek
提出日時 2024-01-12 22:19:02
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 2,033 bytes
コンパイル時間 2,054 ms
コンパイル使用メモリ 204,564 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2024-01-12 22:19:09
合計ジャッジ時間 6,972 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,548 KB
testcase_01 AC 2 ms
6,548 KB
testcase_02 AC 2 ms
6,548 KB
testcase_03 AC 2 ms
6,548 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 17 ms
6,548 KB
testcase_12 AC 21 ms
6,548 KB
testcase_13 AC 10 ms
6,548 KB
testcase_14 AC 22 ms
6,548 KB
testcase_15 AC 13 ms
6,548 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 16 ms
6,548 KB
testcase_19 AC 17 ms
6,548 KB
testcase_20 AC 25 ms
6,548 KB
testcase_21 AC 14 ms
6,548 KB
testcase_22 AC 17 ms
6,548 KB
testcase_23 AC 12 ms
6,548 KB
testcase_24 AC 16 ms
6,548 KB
testcase_25 AC 17 ms
6,548 KB
testcase_26 WA -
testcase_27 AC 19 ms
6,548 KB
testcase_28 WA -
testcase_29 AC 17 ms
6,548 KB
testcase_30 AC 18 ms
6,548 KB
testcase_31 AC 20 ms
6,548 KB
testcase_32 AC 17 ms
6,548 KB
testcase_33 WA -
testcase_34 AC 20 ms
6,548 KB
testcase_35 AC 13 ms
6,548 KB
testcase_36 AC 13 ms
6,548 KB
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 AC 19 ms
6,548 KB
testcase_43 AC 20 ms
6,548 KB
testcase_44 WA -
testcase_45 WA -
testcase_46 AC 15 ms
6,548 KB
testcase_47 WA -
testcase_48 WA -
testcase_49 AC 14 ms
6,548 KB
testcase_50 WA -
testcase_51 AC 12 ms
6,548 KB
testcase_52 WA -
testcase_53 WA -
testcase_54 AC 16 ms
6,548 KB
testcase_55 WA -
testcase_56 AC 18 ms
6,548 KB
testcase_57 AC 16 ms
6,548 KB
testcase_58 WA -
testcase_59 AC 20 ms
6,548 KB
testcase_60 AC 18 ms
6,548 KB
testcase_61 AC 14 ms
6,548 KB
testcase_62 WA -
testcase_63 AC 23 ms
6,548 KB
testcase_64 WA -
testcase_65 WA -
testcase_66 WA -
testcase_67 WA -
testcase_68 AC 12 ms
6,548 KB
testcase_69 WA -
testcase_70 AC 10 ms
6,548 KB
testcase_71 WA -
testcase_72 AC 19 ms
6,548 KB
testcase_73 AC 16 ms
6,548 KB
testcase_74 AC 20 ms
6,548 KB
testcase_75 AC 21 ms
6,548 KB
testcase_76 WA -
testcase_77 AC 21 ms
6,548 KB
testcase_78 WA -
testcase_79 AC 21 ms
6,548 KB
testcase_80 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include "bits/stdc++.h"
using namespace std;
#define all(x) begin(x),end(x)
template<typename A, typename B> ostream& operator<<(ostream &os, const pair<A, B> &p) { return os << '(' << p.first << ", " << p.second << ')'; }
template<typename T_container, typename T = typename enable_if<!is_same<T_container, string>::value, typename T_container::value_type>::type> ostream& operator<<(ostream &os, const T_container &v) { string sep; for (const T &x : v) os << sep << x, sep = " "; return os; }
#define debug(a) cerr << "(" << #a << ": " << a << ")\n";
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pi;
const int mxN = 1e5+1, oo = 1e9;
typedef complex<int> pt;
#define X real()
#define Y imag()
auto cross(pt u, pt v) {return (ll)u.X*v.Y-(ll)u.Y*v.X;}
auto sgn(ll a) {return a==0?0:(a>0?1:-1);}
auto ccw(pt p1, pt p2, pt p3) {auto u = p2-p1, v = p3-p2;return cross(u,v);}
auto in(pt p1, pt p2) {return (ll)p1.X*p2.X+(ll)p1.Y*p2.Y;}
auto norm2(pt p) {return (ll)p.X*p.X+(ll)p.Y*p.Y;}
bool comp(const pt& a, const pt& b) { return a.X<b.X or (a.X==b.X and a.Y < b.Y);}
void read(pt& p) {
    int a,b; cin >> a >> b;
    p = {a*2,b*2};
}
typedef __int128_t lll;
typedef pt P;
lll circV(P p, P a, P b, P c) { // is p in the circumcircle?
	lll p2 = norm2(p), A = norm2(a)-p2,
	    B = norm2(b)-p2, C = norm2(c)-p2;
	return ccw(p,a,b)*C + ccw(p,b,c)*A + ccw(p,c,a)*B;
}
bool incircle(pt p, pt a, pt b) {
    auto mid = (a+b)/2;
    return norm2(p-mid)*4 <= norm2(b-a);
}
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int q; cin >> q;
    array<pt,3> cs;
    for(auto& i : cs) read(i);
    bool twop=0;
    for(int i=0;i<3;++i) {
        rotate(cs.begin(),cs.begin()+1,cs.end());
        if(incircle(cs[2],cs[0],cs[1])) {
            twop=1;
            break;
        }
    }
    

    while(q--) {
        pt p; read(p);
        if(twop?incircle(p,cs[0],cs[1]):circV(p,cs[0],cs[1],cs[2])<=0) {
            cout << "Yes\n";
        } else cout << "No\n";
    }
}   
0