Submission #135986

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
1359862019-07-24 15:04:39onjo0127Tri (CEOI09_tri)C++11
100 / 100
202 ms14284 KiB
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pll = pair<ll, ll>;
#define X first
#define Y second
#define sz(V) ((int)V.size())
struct query { int id; pll A, B; };
int CCW(pll A, pll B, pll C) {
long long tmp = A.X*B.Y + B.X*C.Y + C.X*A.Y - A.Y*B.X - B.Y*C.X - C.Y*A.X;
if(tmp < 0LL) return -1;
if(tmp == 0LL) return 0;
if(tmp > 0LL) return +1;
}
bool operator <(pll A, pll B) { return CCW({0, 0}, A, B) == 1; }
bool operator <=(pll A, pll B) { return CCW({0, 0}, A, B) >= 0; }
pll add(pll A, pll B, pll C) {
return {A.X + C.X - B.X, A.Y + C.Y - B.Y};
}
bool chk(vector<pll> &H, pll A, pll B) {
if(B < A) swap(A, B);
bool f = 0;
int l = 0, r = sz(H) - 1;
while(l <= r) {
int m = l+r >> 1;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

tri.cpp: In function 'bool chk(std::vector<std::pair<long long int, long long int> >&, pll, pll)':
tri.cpp:30:12: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   int m = l+r >> 1;
           ~^~
tri.cpp: In function 'void go(int, int, int, pll, pll, int)':
tri.cpp:44:11: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
  int m = s+e >> 1;
          ~^~
tri.cpp: In function 'void dnc(int, int, int)':
tri.cpp:55:11: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
  int m = s+e >> 1;
          ~^~
tri.cpp: In function 'int CCW(pll, pll, pll)':
tri.cpp:16:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
tri.cpp: In function 'int main()':
tri.cpp:87:17: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  int K, M; scanf("%d%d",&K,&M);
            ~~~~~^~~~~~~~~~~~~~
tri.cpp:88:31: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  for(int i=1; i<=K; i++) scanf("%lld%lld", &P[i].X, &P[i].Y);
                          ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tri.cpp:91:18: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   pll A, B; scanf("%lld%lld%lld%lld", &A.X, &A.Y, &B.X, &B.Y);
             ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...