message
stringlengths
2
44.5k
message_type
stringclasses
2 values
message_id
int64
0
1
conversation_id
int64
276
109k
cluster
float64
23
23
__index_level_0__
int64
552
217k
Provide tags and a correct Python 3 solution for this coding contest problem. You are given two circles. Find the area of their intersection. Input The first line contains three integers x1, y1, r1 ( - 109 ≤ x1, y1 ≤ 109, 1 ≤ r1 ≤ 109) — the position of the center and the radius of the first circle. The second line...
instruction
0
50,064
23
100,128
Tags: geometry Correct Solution: ``` import decimal from decimal import Decimal pi = Decimal('3.14159265358979323846264338327950288419716939937510') decimal.getcontext().prec = 40 def cos(x): """Return the cosine of x as measured in radians. The Taylor series approximation works best for a small value of x....
output
1
50,064
23
100,129
Provide tags and a correct Python 3 solution for this coding contest problem. You are given two circles. Find the area of their intersection. Input The first line contains three integers x1, y1, r1 ( - 109 ≤ x1, y1 ≤ 109, 1 ≤ r1 ≤ 109) — the position of the center and the radius of the first circle. The second line...
instruction
0
50,065
23
100,130
Tags: geometry Correct Solution: ``` """ Codeforces Educational Round #2 Problem 600 D. Area of Two Circles' Intersection @author yamaton @date 2015-11-30 2015-12-02 """ import sys import math import fractions def f(x): """ Compute x - sin(x) cos(x) without loss of significance """ if abs(x)...
output
1
50,065
23
100,131
Provide tags and a correct Python 3 solution for this coding contest problem. You are given two circles. Find the area of their intersection. Input The first line contains three integers x1, y1, r1 ( - 109 ≤ x1, y1 ≤ 109, 1 ≤ r1 ≤ 109) — the position of the center and the radius of the first circle. The second line...
instruction
0
50,066
23
100,132
Tags: geometry Correct Solution: ``` import math from decimal import Decimal from decimal import getcontext from math import acos pi = Decimal('3.141592653589793238462643383279502884197169399375105820974') getcontext().prec=100 eps = 2e-7 def _acos(x): if 1 - eps > abs(x) > eps: return Decimal(acos(x))...
output
1
50,066
23
100,133
Provide tags and a correct Python 3 solution for this coding contest problem. You are given two circles. Find the area of their intersection. Input The first line contains three integers x1, y1, r1 ( - 109 ≤ x1, y1 ≤ 109, 1 ≤ r1 ≤ 109) — the position of the center and the radius of the first circle. The second line...
instruction
0
50,067
23
100,134
Tags: geometry Correct Solution: ``` from math import cos, sin from decimal import Decimal, getcontext getcontext().prec = 100 def sind(x): res = x xpow = x fact = 1 i = 3 while True: xpow *= -x * x fact *= i * (i-1) next_ = res + xpow / fact if res == next_: break ...
output
1
50,067
23
100,135
Provide tags and a correct Python 3 solution for this coding contest problem. You are given two circles. Find the area of their intersection. Input The first line contains three integers x1, y1, r1 ( - 109 ≤ x1, y1 ≤ 109, 1 ≤ r1 ≤ 109) — the position of the center and the radius of the first circle. The second line...
instruction
0
50,068
23
100,136
Tags: geometry Correct Solution: ``` #!/usr/bin/env python3 # 600D_circles.py - Codeforces.com/problemset/problem/600/D by Sergey 2015 import unittest import sys import math import decimal ############################################################################### # Circles Class (Main Program) ##################...
output
1
50,068
23
100,137
Provide tags and a correct Python 3 solution for this coding contest problem. You are given two circles. Find the area of their intersection. Input The first line contains three integers x1, y1, r1 ( - 109 ≤ x1, y1 ≤ 109, 1 ≤ r1 ≤ 109) — the position of the center and the radius of the first circle. The second line...
instruction
0
50,069
23
100,138
Tags: geometry Correct Solution: ``` from decimal import Decimal, getcontext class Trigonometry(): def __init__(self, precision): getcontext().prec = precision self.pi = self._pi_() def _pi_(self): lo, hi = Decimal('3.14'), Decimal('3.15') while True: mid = (lo + hi...
output
1
50,069
23
100,139
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You are given two circles. Find the area of their intersection. Input The first line contains three integers x1, y1, r1 ( - 109 ≤ x1, y1 ≤ 109, 1 ≤ r1 ≤ 109) — the position of the center and t...
instruction
0
50,070
23
100,140
Yes
output
1
50,070
23
100,141
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You are given two circles. Find the area of their intersection. Input The first line contains three integers x1, y1, r1 ( - 109 ≤ x1, y1 ≤ 109, 1 ≤ r1 ≤ 109) — the position of the center and t...
instruction
0
50,071
23
100,142
Yes
output
1
50,071
23
100,143
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You are given two circles. Find the area of their intersection. Input The first line contains three integers x1, y1, r1 ( - 109 ≤ x1, y1 ≤ 109, 1 ≤ r1 ≤ 109) — the position of the center and t...
instruction
0
50,072
23
100,144
Yes
output
1
50,072
23
100,145
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You are given two circles. Find the area of their intersection. Input The first line contains three integers x1, y1, r1 ( - 109 ≤ x1, y1 ≤ 109, 1 ≤ r1 ≤ 109) — the position of the center and t...
instruction
0
50,073
23
100,146
Yes
output
1
50,073
23
100,147
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You are given two circles. Find the area of their intersection. Input The first line contains three integers x1, y1, r1 ( - 109 ≤ x1, y1 ≤ 109, 1 ≤ r1 ≤ 109) — the position of the center and t...
instruction
0
50,074
23
100,148
No
output
1
50,074
23
100,149
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You are given two circles. Find the area of their intersection. Input The first line contains three integers x1, y1, r1 ( - 109 ≤ x1, y1 ≤ 109, 1 ≤ r1 ≤ 109) — the position of the center and t...
instruction
0
50,075
23
100,150
No
output
1
50,075
23
100,151
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You are given two circles. Find the area of their intersection. Input The first line contains three integers x1, y1, r1 ( - 109 ≤ x1, y1 ≤ 109, 1 ≤ r1 ≤ 109) — the position of the center and t...
instruction
0
50,076
23
100,152
No
output
1
50,076
23
100,153
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You are given two circles. Find the area of their intersection. Input The first line contains three integers x1, y1, r1 ( - 109 ≤ x1, y1 ≤ 109, 1 ≤ r1 ≤ 109) — the position of the center and t...
instruction
0
50,077
23
100,154
No
output
1
50,077
23
100,155
Provide tags and a correct Python 3 solution for this coding contest problem. You have n distinct points on a plane, none of them lie on OY axis. Check that there is a point after removal of which the remaining points are located on one side of the OY axis. Input The first line contains a single positive integer n (...
instruction
0
50,197
23
100,394
Tags: geometry, implementation Correct Solution: ``` t=int(input()) cnt=0 cnt1=0 for i in range(t): m,n=map(int,input().split()) if m>0: cnt+=1 if m<0: cnt1+=1 if cnt==t or cnt==t-1 or cnt==0 or cnt==1: print("Yes") else: print("No") ```
output
1
50,197
23
100,395
Provide tags and a correct Python 3 solution for this coding contest problem. You have n distinct points on a plane, none of them lie on OY axis. Check that there is a point after removal of which the remaining points are located on one side of the OY axis. Input The first line contains a single positive integer n (...
instruction
0
50,198
23
100,396
Tags: geometry, implementation Correct Solution: ``` import sys cases = int(sys.stdin.readline()) points = [] for i in range(0, cases): point = sys.stdin.readline().strip().split(" ") points.append((int(point[0]), int(point[1]))) side_a = 0 side_b = 0 for point in points: if point[0] < 0: side_a = side_a +...
output
1
50,198
23
100,397
Provide tags and a correct Python 3 solution for this coding contest problem. You have n distinct points on a plane, none of them lie on OY axis. Check that there is a point after removal of which the remaining points are located on one side of the OY axis. Input The first line contains a single positive integer n (...
instruction
0
50,199
23
100,398
Tags: geometry, implementation Correct Solution: ``` __author__ = 'smart131' n = int(input()) a = [list(map(int, input().split())) for i in range (n)] a.sort() if a[1][0] > 0 or a[n - 2][0] < 0: print("Yes") else: print("No") ```
output
1
50,199
23
100,399
Provide tags and a correct Python 3 solution for this coding contest problem. You have n distinct points on a plane, none of them lie on OY axis. Check that there is a point after removal of which the remaining points are located on one side of the OY axis. Input The first line contains a single positive integer n (...
instruction
0
50,200
23
100,400
Tags: geometry, implementation Correct Solution: ``` casos = int(input()) left = [] right = [] for i in range(casos): x, y = map(int, input().split()) if(x < 0): left.append([x, y]) else: right.append([x, y]) if(len(left) > 1 and len(right) > 1): print("No") else: print("Yes") ```
output
1
50,200
23
100,401
Provide tags and a correct Python 3 solution for this coding contest problem. You have n distinct points on a plane, none of them lie on OY axis. Check that there is a point after removal of which the remaining points are located on one side of the OY axis. Input The first line contains a single positive integer n (...
instruction
0
50,201
23
100,402
Tags: geometry, implementation Correct Solution: ``` import math,itertools,fractions,heapq,collections,bisect,sys,queue,copy sys.setrecursionlimit(10**7) inf=10**20 mod=10**9+7 dd=[(-1,0),(0,1),(1,0),(0,-1)] ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)] def LI(): return [int(x) for x in sys.stdin.readli...
output
1
50,201
23
100,403
Provide tags and a correct Python 3 solution for this coding contest problem. You have n distinct points on a plane, none of them lie on OY axis. Check that there is a point after removal of which the remaining points are located on one side of the OY axis. Input The first line contains a single positive integer n (...
instruction
0
50,202
23
100,404
Tags: geometry, implementation Correct Solution: ``` # -*- coding: utf-8 -*- """ Created on Mon Dec 11 19:04:36 2017 @author: ms """ def main(): n = int(input()) pos = 0 neg = 0 for i in range(n): if ([int(x) for x in input().split()][0]) > 0: pos += 1 else: ...
output
1
50,202
23
100,405
Provide tags and a correct Python 3 solution for this coding contest problem. You have n distinct points on a plane, none of them lie on OY axis. Check that there is a point after removal of which the remaining points are located on one side of the OY axis. Input The first line contains a single positive integer n (...
instruction
0
50,203
23
100,406
Tags: geometry, implementation Correct Solution: ``` n = int(input()) a = [input() for i in range(n)] p = 0 for j in range(n): if a[j][0] == '-': p += 1 if p > 1 and n-p > 3: print('NO') elif n-p > 1 and p > 1: print('NO') else: print('YES') ```
output
1
50,203
23
100,407
Provide tags and a correct Python 3 solution for this coding contest problem. You have n distinct points on a plane, none of them lie on OY axis. Check that there is a point after removal of which the remaining points are located on one side of the OY axis. Input The first line contains a single positive integer n (...
instruction
0
50,204
23
100,408
Tags: geometry, implementation Correct Solution: ``` import sys import io, os input = sys.stdin.buffer.readline n = int(input()) XY = [0]*n cnt = 0 for i in range(n): x,y = map(int, input().split()) if x > 0: cnt += 1 if cnt == 1 or n-cnt == 1 or n-cnt == 0 or cnt ==0: print('Yes') else: print...
output
1
50,204
23
100,409
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You have n distinct points on a plane, none of them lie on OY axis. Check that there is a point after removal of which the remaining points are located on one side of the OY axis. Input The fi...
instruction
0
50,205
23
100,410
Yes
output
1
50,205
23
100,411
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You have n distinct points on a plane, none of them lie on OY axis. Check that there is a point after removal of which the remaining points are located on one side of the OY axis. Input The fi...
instruction
0
50,206
23
100,412
Yes
output
1
50,206
23
100,413
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You have n distinct points on a plane, none of them lie on OY axis. Check that there is a point after removal of which the remaining points are located on one side of the OY axis. Input The fi...
instruction
0
50,207
23
100,414
Yes
output
1
50,207
23
100,415
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You have n distinct points on a plane, none of them lie on OY axis. Check that there is a point after removal of which the remaining points are located on one side of the OY axis. Input The fi...
instruction
0
50,208
23
100,416
Yes
output
1
50,208
23
100,417
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You have n distinct points on a plane, none of them lie on OY axis. Check that there is a point after removal of which the remaining points are located on one side of the OY axis. Input The fi...
instruction
0
50,209
23
100,418
No
output
1
50,209
23
100,419
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You have n distinct points on a plane, none of them lie on OY axis. Check that there is a point after removal of which the remaining points are located on one side of the OY axis. Input The fi...
instruction
0
50,210
23
100,420
No
output
1
50,210
23
100,421
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You have n distinct points on a plane, none of them lie on OY axis. Check that there is a point after removal of which the remaining points are located on one side of the OY axis. Input The fi...
instruction
0
50,211
23
100,422
No
output
1
50,211
23
100,423
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You have n distinct points on a plane, none of them lie on OY axis. Check that there is a point after removal of which the remaining points are located on one side of the OY axis. Input The fi...
instruction
0
50,212
23
100,424
No
output
1
50,212
23
100,425
Provide a correct Python 3 solution for this coding contest problem. Write a program which prints the central coordinate ($cx$,$cy$) and the radius $r$ of a incircle of a triangle which is constructed by three points ($x_1$, $y_1$), ($x_2$, $y_2$) and ($x_3$, $y_3$) on the plane surface. Constraints * $-10000 \leq x...
instruction
0
50,492
23
100,984
"Correct Solution: ``` import math x1, y1 = map(int, input().split()) x2, y2 = map(int, input().split()) x3, y3 = map(int, input().split()) #3辺の長さ a = math.sqrt(((x1-x2)**2)+((y1-y2)**2)) b = math.sqrt(((x3-x2)**2)+((y3-y2)**2)) c = math.sqrt(((x1-x3)**2)+((y1-y3)**2)) s = (a+b+c)/2 r = math.sqrt(s*(s-a)*(s-b)*(s-c)...
output
1
50,492
23
100,985
Provide tags and a correct Python 3 solution for this coding contest problem. There are n points on the plane, the i-th of which is at (x_i, y_i). Tokitsukaze wants to draw a strange rectangular area and pick all the points in the area. The strange area is enclosed by three lines, x = l, y = a and x = r, as its left ...
instruction
0
50,575
23
101,150
Tags: data structures, divide and conquer, sortings, two pointers Correct Solution: ``` import sys from operator import add class Stree: def __init__(self, f, n, default, init_data): self.ln = 2**(n-1).bit_length() self.data = [default] * (self.ln * 2) self.f = f for i, d in init_da...
output
1
50,575
23
101,151
Provide tags and a correct Python 3 solution for this coding contest problem. There are n points on the plane, the i-th of which is at (x_i, y_i). Tokitsukaze wants to draw a strange rectangular area and pick all the points in the area. The strange area is enclosed by three lines, x = l, y = a and x = r, as its left ...
instruction
0
50,576
23
101,152
Tags: data structures, divide and conquer, sortings, two pointers Correct Solution: ``` from sys import stdin, stdout from collections import defaultdict n = int(input()) pts = [] for i in range(n): x, y = map(int, stdin.readline().split()) pts.append((x, y)) pts.sort() cts = [0]*(n+1) x_map = {} ctr = 0 for ...
output
1
50,576
23
101,153
Provide tags and a correct Python 3 solution for this coding contest problem. There are n points on the plane, the i-th of which is at (x_i, y_i). Tokitsukaze wants to draw a strange rectangular area and pick all the points in the area. The strange area is enclosed by three lines, x = l, y = a and x = r, as its left ...
instruction
0
50,577
23
101,154
Tags: data structures, divide and conquer, sortings, two pointers Correct Solution: ``` import sys import copy input = sys.stdin.readline n=int(input()) P=[list(map(int,input().split())) for i in range(n)] SET_X=set() SET_Y=set() for x,y in P: SET_X.add(x) SET_Y.add(y) CX=sorted(SET_X) CY=sorted(SET_Y) LEN...
output
1
50,577
23
101,155
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. There are n points on the plane, the i-th of which is at (x_i, y_i). Tokitsukaze wants to draw a strange rectangular area and pick all the points in the area. The strange area is enclosed by th...
instruction
0
50,578
23
101,156
No
output
1
50,578
23
101,157
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. There are n points on the plane, the i-th of which is at (x_i, y_i). Tokitsukaze wants to draw a strange rectangular area and pick all the points in the area. The strange area is enclosed by th...
instruction
0
50,579
23
101,158
No
output
1
50,579
23
101,159
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. There are n points on the plane, the i-th of which is at (x_i, y_i). Tokitsukaze wants to draw a strange rectangular area and pick all the points in the area. The strange area is enclosed by th...
instruction
0
50,580
23
101,160
No
output
1
50,580
23
101,161
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. There are n points on the plane, the i-th of which is at (x_i, y_i). Tokitsukaze wants to draw a strange rectangular area and pick all the points in the area. The strange area is enclosed by th...
instruction
0
50,581
23
101,162
No
output
1
50,581
23
101,163
Provide tags and a correct Python 3 solution for this coding contest problem. This is an interactive problem. There exists a matrix a of size n × m (n rows and m columns), you know only numbers n and m. The rows of the matrix are numbered from 1 to n from top to bottom, and columns of the matrix are numbered from 1 t...
instruction
0
50,720
23
101,440
Tags: bitmasks, interactive, number theory Correct Solution: ``` import sys input = sys.stdin.readline def solve(): r, c = map(int, input().split()) r1 = r r2 = r i = 2 while True: if r2 % i == 0: while r2 % i == 0: r2 //= i while r1 % i == 0: #print('r',i) if i == 2: print('?',r1//i,c,1...
output
1
50,720
23
101,441
Provide tags and a correct Python 3 solution for this coding contest problem. This is an interactive problem. There exists a matrix a of size n × m (n rows and m columns), you know only numbers n and m. The rows of the matrix are numbered from 1 to n from top to bottom, and columns of the matrix are numbered from 1 t...
instruction
0
50,721
23
101,442
Tags: bitmasks, interactive, number theory Correct Solution: ``` import sys input = sys.stdin.readline flush = sys.stdout.flush from collections import Counter from math import sqrt def query(h, w, i1, j1, i2, j2): print("? {} {} {} {} {} {}".format(h, w, i1, j1, i2, j2)) flush() return int(input()) def f...
output
1
50,721
23
101,443
Provide tags and a correct Python 3 solution for this coding contest problem. This is an interactive problem. There exists a matrix a of size n × m (n rows and m columns), you know only numbers n and m. The rows of the matrix are numbered from 1 to n from top to bottom, and columns of the matrix are numbered from 1 t...
instruction
0
50,722
23
101,444
Tags: bitmasks, interactive, number theory Correct Solution: ``` import sys input = sys.stdin.readline flush = sys.stdout.flush from collections import Counter from math import sqrt def query(h, w, i1, j1, i2, j2): print("? {} {} {} {} {} {}".format(h, w, i1, j1, i2, j2)) flush() return int(input()) def f...
output
1
50,722
23
101,445
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. This is an interactive problem. There exists a matrix a of size n × m (n rows and m columns), you know only numbers n and m. The rows of the matrix are numbered from 1 to n from top to bottom, ...
instruction
0
50,723
23
101,446
No
output
1
50,723
23
101,447
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. This is an interactive problem. There exists a matrix a of size n × m (n rows and m columns), you know only numbers n and m. The rows of the matrix are numbered from 1 to n from top to bottom, ...
instruction
0
50,724
23
101,448
No
output
1
50,724
23
101,449
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. This is an interactive problem. There exists a matrix a of size n × m (n rows and m columns), you know only numbers n and m. The rows of the matrix are numbered from 1 to n from top to bottom, ...
instruction
0
50,725
23
101,450
No
output
1
50,725
23
101,451
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. This is an interactive problem. There exists a matrix a of size n × m (n rows and m columns), you know only numbers n and m. The rows of the matrix are numbered from 1 to n from top to bottom, ...
instruction
0
50,726
23
101,452
No
output
1
50,726
23
101,453
Provide tags and a correct Python 3 solution for this coding contest problem. There is a board with a grid consisting of n rows and m columns, the rows are numbered from 1 from top to bottom and the columns are numbered from 1 from left to right. In this grid we will denote the cell that lies on row number i and colum...
instruction
0
50,766
23
101,532
Tags: brute force, implementation Correct Solution: ``` from sys import stdin def read(): return map(int, stdin.readline().split()) def ways(h,w,area): if area == h*w: return 2 * ( (h+1)//2 * (w+1)//2 ) - 1 if area > h*w: return 0 if area < h+w-1: return 0 area = h*w - area if area % 4 != 0: return...
output
1
50,766
23
101,533
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. There is a board with a grid consisting of n rows and m columns, the rows are numbered from 1 from top to bottom and the columns are numbered from 1 from left to right. In this grid we will deno...
instruction
0
50,767
23
101,534
No
output
1
50,767
23
101,535
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. There is a board with a grid consisting of n rows and m columns, the rows are numbered from 1 from top to bottom and the columns are numbered from 1 from left to right. In this grid we will deno...
instruction
0
50,768
23
101,536
No
output
1
50,768
23
101,537
Provide a correct Python 3 solution for this coding contest problem. With the motto "Creating your own path," a shrine created a fortune-telling fortune with its own hands. Ask the person who draws the lottery to throw six stones first, then the line segment connecting the first and second of the thrown stones, the li...
instruction
0
51,224
23
102,448
"Correct Solution: ``` # Aizu Problem 0187: Stoning Fortune # import sys, math, os, bisect # read input: PYDEV = os.environ.get('PYDEV') if PYDEV=="True": sys.stdin = open("sample-input.txt", "rt") def on_segment(p, q, r): # Given three colinear points p, q, r, the function checks if # point q lies on lin...
output
1
51,224
23
102,449
Provide a correct Python 3 solution for this coding contest problem. With the motto "Creating your own path," a shrine created a fortune-telling fortune with its own hands. Ask the person who draws the lottery to throw six stones first, then the line segment connecting the first and second of the thrown stones, the li...
instruction
0
51,225
23
102,450
"Correct Solution: ``` def cross3(O, A, B): ox, oy = O; ax, ay = A; bx, by = B return (ax - ox) * (by - oy) - (bx - ox) * (ay - oy) def outer(x0, y0, x1, y1): return x0*y1 - x1*y0 def is_intersection(P0, P1, Q0, Q1): C0 = cross3(P0, P1, Q0) C1 = cross3(P0, P1, Q1) D0 = cross3(Q0, Q1, P0) D1 ...
output
1
51,225
23
102,451