# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
245490 | MatesV13 | SIR (COI15_sir) | C++11 | 142 ms | 896 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
struct tocka{
long long x;
long long y;
} sir[3005], pap[3005];
long long n, m;
long long p(tocka a, tocka b, tocka c){
long long povrsina=0;
povrsina += a.x*(b.y-c.y);
povrsina += b.x*(c.y-a.y);
povrsina += c.x*(a.y-b.y);
return povrsina;
}
bool check (int idx1, int idx2){
if (idx2-idx1==n-1){
if (m) return 0;
return 1;
}
bool manje=0, vise=0;
if (p(sir[(idx1)%n], sir[(idx2+1)%n], sir[(idx2)%n])<=0) manje=1; else vise=1;
for (int i=0; i<m; i++){
if (p(sir[(idx1)%n], pap[i], sir[(idx2)%n])<=0) manje=1;
if (p(sir[(idx1)%n], pap[i], sir[(idx2)%n])>=0) vise=1;
if (manje and vise) return 0;
} return 1;
}
long long solve (long long lo, long long hi){
long long prvi=lo;
while (lo<hi){
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |