Submission #229402

#TimeUsernameProblemLanguageResultExecution timeMemory
229402VEGAnnZvijezda (COCI19_zvijezda)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #define PB push_back #define sz(x) ((int)x.size()) using namespace std; #ifdef _LOCAL typedef long long ll; #else typedef long long __int128; #endif // _LOCAL const int N = 100100; int n, x[N], y[N], T; bool cw(ll x1, ll y1, ll x2, ll y2, ll x3, ll y3){ return (x1 - x2) * (y1 - y3) - (y1 - y2) * (x1 - x3) < 0; } bool get(int id, int x3, int y3){ int nt = (id + 1); if (nt == n) nt = 0; return !cw(x[id], y[id], x[nt], y[nt], x3, y3); } int main(){ ios_base::sync_with_stdio(0); cin.tie(0); #ifdef _LOCAL freopen("in.txt","r",stdin); freopen("output.txt","w",stdout); #endif // _LOCAL cin >> T >> n; for (int i = 0; i < n; i++) cin >> x[i] >> y[i]; int qq; cin >> qq; int p1 = 0, p2 = n / 2; for (; qq; qq--){ int cx, cy; cin >> cx >> cy; bool fi = get(p1, cx, cy); bool se = get(p2, cx, cy); if (fi && se){ cout << "DA\n"; } else if (!fi && !se){ cout << "NE\n"; } else { if (!fi) swap(p1, p2); int l1 = 1, r1 = n / 2 - 1; while (l1 < r1){ int md = (l1 + r1 + 1) >> 1; if (get((p1 - md + 1 + n) % n, cx, cy)) l1 = md; else r1 = md - 1; } int l2 = 1, r2 = n / 2 - 1; while (l2 < r2){ int md = (l2 + r2 + 1) >> 1; if (get((p1 + md - 1) % n, cx, cy)) l2 = md; else r2 = md - 1; } if ((l1 + l2 - 1) > n / 2) cout << "DA\n"; else cout << "NE\n"; } } return 0; }

Compilation message (stderr)

zvijezda.cpp:8:19: error: declaration does not declare anything [-fpermissive]
 typedef long long __int128;
                   ^~~~~~~~
zvijezda.cpp:13:9: error: 'll' was not declared in this scope
 bool cw(ll x1, ll y1, ll x2, ll y2, ll x3, ll y3){
         ^~
zvijezda.cpp:13:16: error: 'll' was not declared in this scope
 bool cw(ll x1, ll y1, ll x2, ll y2, ll x3, ll y3){
                ^~
zvijezda.cpp:13:23: error: 'll' was not declared in this scope
 bool cw(ll x1, ll y1, ll x2, ll y2, ll x3, ll y3){
                       ^~
zvijezda.cpp:13:30: error: 'll' was not declared in this scope
 bool cw(ll x1, ll y1, ll x2, ll y2, ll x3, ll y3){
                              ^~
zvijezda.cpp:13:37: error: 'll' was not declared in this scope
 bool cw(ll x1, ll y1, ll x2, ll y2, ll x3, ll y3){
                                     ^~
zvijezda.cpp:13:44: error: 'll' was not declared in this scope
 bool cw(ll x1, ll y1, ll x2, ll y2, ll x3, ll y3){
                                            ^~
zvijezda.cpp:13:49: error: expression list treated as compound expression in initializer [-fpermissive]
 bool cw(ll x1, ll y1, ll x2, ll y2, ll x3, ll y3){
                                                 ^
zvijezda.cpp: In function 'bool get(int, int, int)':
zvijezda.cpp:21:50: error: 'cw' cannot be used as a function
     return !cw(x[id], y[id], x[nt], y[nt], x3, y3);
                                                  ^