結果

問題 No.2355 Unhappy Back Dance
ユーザー Jeroen Op de BeekJeroen Op de Beek
提出日時 2023-06-16 21:55:50
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,897 bytes
コンパイル時間 2,127 ms
コンパイル使用メモリ 205,704 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-06 19:34:55
合計ジャッジ時間 6,709 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 119 ms
4,376 KB
testcase_07 AC 102 ms
4,380 KB
testcase_08 AC 102 ms
4,380 KB
testcase_09 WA -
testcase_10 AC 190 ms
4,380 KB
testcase_11 AC 165 ms
4,380 KB
testcase_12 AC 113 ms
4,376 KB
testcase_13 AC 113 ms
4,376 KB
testcase_14 AC 142 ms
4,376 KB
testcase_15 AC 1 ms
4,380 KB
testcase_16 AC 125 ms
4,376 KB
testcase_17 AC 125 ms
4,376 KB
testcase_18 AC 126 ms
4,376 KB
testcase_19 AC 125 ms
4,380 KB
testcase_20 AC 122 ms
4,380 KB
testcase_21 AC 47 ms
4,376 KB
testcase_22 AC 9 ms
4,376 KB
testcase_23 AC 9 ms
4,376 KB
testcase_24 AC 112 ms
4,376 KB
testcase_25 AC 58 ms
4,376 KB
testcase_26 AC 58 ms
4,380 KB
testcase_27 AC 48 ms
4,376 KB
testcase_28 AC 2 ms
4,376 KB
testcase_29 AC 3 ms
4,380 KB
testcase_30 AC 105 ms
4,380 KB
testcase_31 AC 78 ms
4,376 KB
testcase_32 AC 8 ms
4,380 KB
testcase_33 AC 39 ms
4,376 KB
testcase_34 AC 2 ms
4,376 KB
testcase_35 AC 2 ms
4,380 KB
testcase_36 AC 47 ms
4,380 KB
testcase_37 AC 26 ms
4,376 KB
testcase_38 AC 32 ms
4,376 KB
testcase_39 AC 26 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

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 norm(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,b};
}
bool lexo(pt a, pt b) {
    return a.X<b.X or (a.X==b.X and a.Y > b.Y);
}
pt o;
bool polarcomp(const pt& a, const pt& b) {
    bool lex1 = lexo(o,a), lex2 = lexo(o,b);
    if(lex1!=lex2) return lex1<lex2;
    return ccw(o,a,b)>0;
}
int main() {
    int n; cin >> n;
    vector<pt> pts(n);
    for(auto& i : pts) read(i);
    int ans=0;
    for(int i=0;i<n;++i) {
        o = pts[i];
        vector<pt> v;
        v.reserve(n-1);
        for(int j=0;j<n;++j) if(i!=j) v.push_back(pts[j]);
        sort(all(v),polarcomp);
        for(int i=1;i<n-1;++i) {
            if(ccw(o,v[i-1],v[i])==0 and in(v[i-1]-o,v[i]-o)>0) {
                ans++;
                break;
            }
        }
    }
    cout << ans << '\n';
}
0