SlideShare a Scribd company logo
ICPC ~ ~
● !
● !
● !
● !
● !
● !
●
● x,y
!
● 2
● C++ STL complex !
◦ !
● typedef complex<double> Point;!
◦ !
● x real() y imag() !
◦ a(x,y) !
● Point a;!
● a.real() = x; a.imag() = y;!
◦ !
● x:
y:
a(x,y)
O
●
!
◦ a !
●
x
y
a(x,y)
O
complex
● !
◦ complex
!
●
!
struct Point{!
double x,y;!
Point(double a, double b){ x = a; y = b; }!
};
● a,b a-b
!
◦ double dis(Point a, Point b){ return abs(a-b); }
b(xb,yb)
a(xa,ya)
θ b(xb,yb)
a(xa,ya)
  θ b(xb,yb)
a(xa,ya)
● = |a| * |b| * sinθ

= |b| * |b xa |

= × !
● = × / 2

= / 2
10
 
 θ
● 2 a,b c !
● ccw
11
a
b
ccw
int ccw(Point a, Point b, Point c){

if(cross(b-a,c-a)>EPS)return 1;

if(cross(b-a,c-a)<-EPS)return -1;

if(dot(b-a,c-a)<-EPS)return 2;

if(abs(b-a)+EPS<abs(c-a)return -2;

return 0;

}
12
a
b
: AOJ0035 Is It Convex?
● !
●
13
● 2
!
● 2
!
◦ typedef pair<Point, Point> Line;!
●
a
b
a
b
ab ab
 
a
b
c
θ
● ab c
a,b c !
●
a
b
c
a
b
c
● a : ∠BAC > 90°!
● b : ∠ABC > 90°!
● : !
∠BAC <= 90° ABC <= 90°!
● cosθ(= )
a
b
c
a
b
c
double seg_to_point_dis(Line l, Point p){!
Point a = l.first, b = l.second, c = p;!
if(dot(b-a,c-a)<EPS)return abs(c-a);!
if(dot(a-b,c-b)<EPS)return abs(c-b);!
return line_to_point_dis(l,p);!
}
a
b
c
a
b
c
●
!
double seg_to_seg_dis(Line a, Line b){!
double res = seg_to_point_dis(a, b.first);!
res = min(res, set_to_point_dis(a, b.second) );!
res = min(res, set_to_point_dis(b, a.first) );!
res = min(res, set_to_point_dis(b, a.second) );!
return res;!
}
● a b !
◦ a 2 b !
◦ b 2 a !
●
a
b
a
b
● a,b !
● b 2 a !
● a 2 b !
● ccw
 
 
α
-β
b1
b2
bool is_cross(Line a, Line b){!
if(ccw(a.first,a.second,b.first)*!
ccw(a.first,a.second,b.second) <= 0 &&
ccw(b.first,b.second,a.first)*!
ccw(b.first,b.second,a.second) <= 0){!
return true;!
}!
return false;!
}
: AOJ2351 Closest Segment Pair
● N !
● !
● 2 ≦ N ≦ 105
!
● 0 ≦ xi,yi ≦ 100
23
 
 
b1
b2
cp
● a , b !
● a !
●
Point cross_point(Line a, Line b){

double d1 = cross(b.second - b.first,

b.first - a.first);

double d2 = cross(b.second - b.first,

a.second - a.first);

return a.first + (a.second - a.first) * d1/d2;

}
25
 
 
b1
b2
cp
d1 = |b2-b1| * |b1-a1| * sinx!
= |b2-b1| * |o1-a1|!
d2 = |b2-b1| * |a1-a1| * siny!
= |b2-b1| * |o2-a1|!
!
d1/d2 = |o1-a1| / |o2-a1|!
= |cp-a1| / |a1-a1|
o1
o2
: AOJ0187 Stoning Fortune
● 3 3
!
●
3 !
● -1000 ≦ xi,yi ≦ 1000
26

More Related Content

What's hot

C project on a bookshop for saving of coustmer record
C project on a bookshop for saving of coustmer recordC project on a bookshop for saving of coustmer record
C project on a bookshop for saving of coustmer record
Zaibi Gondal
 
Jillian Fluet’S Potw Solution
Jillian Fluet’S Potw SolutionJillian Fluet’S Potw Solution
Jillian Fluet’S Potw Solutionjillianfluet
 
Jillians Potw
Jillians PotwJillians Potw
Jillians Potwsabsma
 
11th Maths - Probability - BAYE’S THEOREM
11th Maths - Probability - BAYE’S THEOREM11th Maths - Probability - BAYE’S THEOREM
11th Maths - Probability - BAYE’S THEOREM
Ednexa
 
Engineer event in Kyoto 10-04-17
Engineer event in Kyoto 10-04-17Engineer event in Kyoto 10-04-17
Engineer event in Kyoto 10-04-17ryo katsuma
 
Flow chart diagram
Flow chart diagramFlow chart diagram
Flow chart diagramWhar Zina
 
Closest point on OBB to point by j3j3bu5t3r5
Closest point on OBB to point by j3j3bu5t3r5Closest point on OBB to point by j3j3bu5t3r5
Closest point on OBB to point by j3j3bu5t3r5gsantos15
 
Afshaa fybca1
Afshaa fybca1Afshaa fybca1
Afshaa fybca1
AfshaaFeroz
 
Leyes de conjuntos (Grafos)
Leyes de conjuntos (Grafos)Leyes de conjuntos (Grafos)
Leyes de conjuntos (Grafos)
Juan Marcano - Marketing Online
 
Strongly Connected Components
Strongly Connected Components Strongly Connected Components
Strongly Connected Components
Md. Shafiuzzaman Hira
 
Efficient Random-Walk Methods forApproximating Polytope Volume
Efficient Random-Walk Methods forApproximating Polytope VolumeEfficient Random-Walk Methods forApproximating Polytope Volume
Efficient Random-Walk Methods forApproximating Polytope Volume
Vissarion Fisikopoulos
 
Fuvest 2017 - aberta
Fuvest 2017 - abertaFuvest 2017 - aberta
Fuvest 2017 - aberta
KalculosOnline
 
Gaya horizontal pada tiang pancang
Gaya horizontal pada tiang pancangGaya horizontal pada tiang pancang
Gaya horizontal pada tiang pancang
Nurul Angreliany
 
วิธีการคำนวณเงินกู้และดอกเบี้ย
วิธีการคำนวณเงินกู้และดอกเบี้ยวิธีการคำนวณเงินกู้และดอกเบี้ย
วิธีการคำนวณเงินกู้และดอกเบี้ยLoveLovearm
 

What's hot (16)

C project on a bookshop for saving of coustmer record
C project on a bookshop for saving of coustmer recordC project on a bookshop for saving of coustmer record
C project on a bookshop for saving of coustmer record
 
Jillian Fluet’S Potw Solution
Jillian Fluet’S Potw SolutionJillian Fluet’S Potw Solution
Jillian Fluet’S Potw Solution
 
Jillians Potw
Jillians PotwJillians Potw
Jillians Potw
 
11th Maths - Probability - BAYE’S THEOREM
11th Maths - Probability - BAYE’S THEOREM11th Maths - Probability - BAYE’S THEOREM
11th Maths - Probability - BAYE’S THEOREM
 
Engineer event in Kyoto 10-04-17
Engineer event in Kyoto 10-04-17Engineer event in Kyoto 10-04-17
Engineer event in Kyoto 10-04-17
 
Flow chart diagram
Flow chart diagramFlow chart diagram
Flow chart diagram
 
Closest point on OBB to point by j3j3bu5t3r5
Closest point on OBB to point by j3j3bu5t3r5Closest point on OBB to point by j3j3bu5t3r5
Closest point on OBB to point by j3j3bu5t3r5
 
3
33
3
 
Afshaa fybca1
Afshaa fybca1Afshaa fybca1
Afshaa fybca1
 
Leyes de conjuntos (Grafos)
Leyes de conjuntos (Grafos)Leyes de conjuntos (Grafos)
Leyes de conjuntos (Grafos)
 
Strongly Connected Components
Strongly Connected Components Strongly Connected Components
Strongly Connected Components
 
Efficient Random-Walk Methods forApproximating Polytope Volume
Efficient Random-Walk Methods forApproximating Polytope VolumeEfficient Random-Walk Methods forApproximating Polytope Volume
Efficient Random-Walk Methods forApproximating Polytope Volume
 
Fuvest 2017 - aberta
Fuvest 2017 - abertaFuvest 2017 - aberta
Fuvest 2017 - aberta
 
Gaya horizontal pada tiang pancang
Gaya horizontal pada tiang pancangGaya horizontal pada tiang pancang
Gaya horizontal pada tiang pancang
 
week-5x
week-5xweek-5x
week-5x
 
วิธีการคำนวณเงินกู้และดอกเบี้ย
วิธีการคำนวณเงินกู้และดอกเบี้ยวิธีการคำนวณเงินกู้และดอกเบี้ย
วิธีการคำนวณเงินกู้และดอกเบี้ย
 

Similar to Kika

Kuliah 10 Vektor.pptx
Kuliah 10 Vektor.pptxKuliah 10 Vektor.pptx
Kuliah 10 Vektor.pptx
ZaenurRohman7
 
Rotation
RotationRotation
Rotationgistri
 
Arduino coding class
Arduino coding classArduino coding class
Arduino coding class
Jonah Marrs
 
popquiz-q2math.pptx
popquiz-q2math.pptxpopquiz-q2math.pptx
popquiz-q2math.pptx
EdenGuerrero
 
Sop and pos
Sop and posSop and pos
Sop and pos
shubhamprajapat23
 
"A 1,500 line (!!) switch statement powers your Python!" - Allison Kaptur, !!...
"A 1,500 line (!!) switch statement powers your Python!" - Allison Kaptur, !!..."A 1,500 line (!!) switch statement powers your Python!" - Allison Kaptur, !!...
"A 1,500 line (!!) switch statement powers your Python!" - Allison Kaptur, !!...akaptur
 
Função afim resumo teórico e exercícios - celso brasil
Função afim   resumo teórico e exercícios - celso brasilFunção afim   resumo teórico e exercícios - celso brasil
Função afim resumo teórico e exercícios - celso brasil
Celso do Rozário Brasil Gonçalves
 
pendik escort
pendik escortpendik escort
pendik escort
pendik escort
 
Problemas resueltos de funciones lineales ccesa007
Problemas resueltos de  funciones lineales ccesa007Problemas resueltos de  funciones lineales ccesa007
Problemas resueltos de funciones lineales ccesa007
Demetrio Ccesa Rayme
 
Matlab operators
Matlab operatorsMatlab operators
Matlab operators
Aswin Pv
 
Raices de ecuaciones
Raices de ecuacionesRaices de ecuaciones
Raices de ecuacionesNatalia
 
Raices de ecuaciones
Raices de ecuacionesRaices de ecuaciones
Raices de ecuacionesNatalia
 
Combinator parsing
Combinator parsingCombinator parsing
Combinator parsing
Swanand Pagnis
 
Mathematical preliminaries in Automata
Mathematical preliminaries in AutomataMathematical preliminaries in Automata
Mathematical preliminaries in Automata
Mobeen Mustafa
 
C - programming - Ankit Kumar Singh
C - programming - Ankit Kumar Singh C - programming - Ankit Kumar Singh
C - programming - Ankit Kumar Singh
AnkitSinghRajput35
 
Lecture 4 (27)
Lecture 4 (27)Lecture 4 (27)
Lecture 4 (27)
Basel Samhouri
 
PUSH DOWN AUTOMATA VS TURING MACHINE
PUSH DOWN AUTOMATA VS TURING MACHINEPUSH DOWN AUTOMATA VS TURING MACHINE
PUSH DOWN AUTOMATA VS TURING MACHINE
Abhishek Shivhare
 

Similar to Kika (20)

D1
D1D1
D1
 
Kuliah 10 Vektor.pptx
Kuliah 10 Vektor.pptxKuliah 10 Vektor.pptx
Kuliah 10 Vektor.pptx
 
Rotation
RotationRotation
Rotation
 
Maths formulae
Maths formulaeMaths formulae
Maths formulae
 
Arduino coding class
Arduino coding classArduino coding class
Arduino coding class
 
popquiz-q2math.pptx
popquiz-q2math.pptxpopquiz-q2math.pptx
popquiz-q2math.pptx
 
Sop and pos
Sop and posSop and pos
Sop and pos
 
Revision1schema C programming
Revision1schema C programmingRevision1schema C programming
Revision1schema C programming
 
"A 1,500 line (!!) switch statement powers your Python!" - Allison Kaptur, !!...
"A 1,500 line (!!) switch statement powers your Python!" - Allison Kaptur, !!..."A 1,500 line (!!) switch statement powers your Python!" - Allison Kaptur, !!...
"A 1,500 line (!!) switch statement powers your Python!" - Allison Kaptur, !!...
 
Função afim resumo teórico e exercícios - celso brasil
Função afim   resumo teórico e exercícios - celso brasilFunção afim   resumo teórico e exercícios - celso brasil
Função afim resumo teórico e exercícios - celso brasil
 
pendik escort
pendik escortpendik escort
pendik escort
 
Problemas resueltos de funciones lineales ccesa007
Problemas resueltos de  funciones lineales ccesa007Problemas resueltos de  funciones lineales ccesa007
Problemas resueltos de funciones lineales ccesa007
 
Matlab operators
Matlab operatorsMatlab operators
Matlab operators
 
Raices de ecuaciones
Raices de ecuacionesRaices de ecuaciones
Raices de ecuaciones
 
Raices de ecuaciones
Raices de ecuacionesRaices de ecuaciones
Raices de ecuaciones
 
Combinator parsing
Combinator parsingCombinator parsing
Combinator parsing
 
Mathematical preliminaries in Automata
Mathematical preliminaries in AutomataMathematical preliminaries in Automata
Mathematical preliminaries in Automata
 
C - programming - Ankit Kumar Singh
C - programming - Ankit Kumar Singh C - programming - Ankit Kumar Singh
C - programming - Ankit Kumar Singh
 
Lecture 4 (27)
Lecture 4 (27)Lecture 4 (27)
Lecture 4 (27)
 
PUSH DOWN AUTOMATA VS TURING MACHINE
PUSH DOWN AUTOMATA VS TURING MACHINEPUSH DOWN AUTOMATA VS TURING MACHINE
PUSH DOWN AUTOMATA VS TURING MACHINE
 

More from HCPC: 北海道大学競技プログラミングサークル

写像 12 相
写像 12 相写像 12 相
ACPC 2017 Day3 F: 掛け算は楽しい
ACPC 2017 Day3 F: 掛け算は楽しいACPC 2017 Day3 F: 掛け算は楽しい
ACPC 2017 Day3 F: 掛け算は楽しい
HCPC: 北海道大学競技プログラミングサークル
 
ACPC 2017 Day3 D: 優柔不断
ACPC 2017 Day3 D: 優柔不断ACPC 2017 Day3 D: 優柔不断
ACPC 2019 Day3 G: Restricted DFS
ACPC 2019 Day3 G: Restricted DFSACPC 2019 Day3 G: Restricted DFS
ACPC 2019 Day3 F: 部分文字列分解
ACPC 2019 Day3 F: 部分文字列分解ACPC 2019 Day3 F: 部分文字列分解
ACPC 2019 Day3 F: 部分文字列分解
HCPC: 北海道大学競技プログラミングサークル
 
ACPC 2019 Day3 E: 総和の切り取り
ACPC 2019 Day3 E: 総和の切り取りACPC 2019 Day3 E: 総和の切り取り
ACPC 2019 Day3 E: 総和の切り取り
HCPC: 北海道大学競技プログラミングサークル
 
ACPC 2019 Day3 B: パフェ
ACPC 2019 Day3 B: パフェACPC 2019 Day3 B: パフェ
ACPC 2019 Day3 A: 間違い探し
ACPC 2019 Day3 A: 間違い探しACPC 2019 Day3 A: 間違い探し
HUPC 2019 Day2 G: 木
HUPC 2019 Day2 G: 木HUPC 2019 Day2 G: 木
HUPC 2019 Day2 E: ジャム
HUPC 2019 Day2 E: ジャムHUPC 2019 Day2 E: ジャム
HUPC 2019 Day2 H: Revenge of UMG
HUPC 2019 Day2 H: Revenge of UMGHUPC 2019 Day2 H: Revenge of UMG
HUPC 2019 Day2 F: MOD Rush
HUPC 2019 Day2 F: MOD RushHUPC 2019 Day2 F: MOD Rush
HUPC 2019 Day2 C: 串刺し
HUPC 2019 Day2 C: 串刺しHUPC 2019 Day2 C: 串刺し
HUPC 2019 Day1 F: グリッドの番号
HUPC 2019 Day1 F: グリッドの番号HUPC 2019 Day1 F: グリッドの番号
HUPC 2019 Day1 F: グリッドの番号
HCPC: 北海道大学競技プログラミングサークル
 
HUPC 2019 Day1 E: 最短経路の復元
HUPC 2019 Day1 E: 最短経路の復元HUPC 2019 Day1 E: 最短経路の復元
HUPC 2019 Day1 E: 最短経路の復元
HCPC: 北海道大学競技プログラミングサークル
 
HUPC 2019 Day1 D: 貪欲が最適?
HUPC 2019 Day1 D: 貪欲が最適?HUPC 2019 Day1 D: 貪欲が最適?
HUPC 2019 Day1 C: 短絡評価
HUPC 2019 Day1 C: 短絡評価HUPC 2019 Day1 C: 短絡評価
HUPC 2019 Day1 B: 自身の 2 倍
HUPC 2019 Day1 B: 自身の 2 倍HUPC 2019 Day1 B: 自身の 2 倍
HUPC 2019 Day1 A: four tea
HUPC 2019 Day1 A: four teaHUPC 2019 Day1 A: four tea
Convex Hull Trick
Convex Hull TrickConvex Hull Trick

More from HCPC: 北海道大学競技プログラミングサークル (20)

写像 12 相
写像 12 相写像 12 相
写像 12 相
 
ACPC 2017 Day3 F: 掛け算は楽しい
ACPC 2017 Day3 F: 掛け算は楽しいACPC 2017 Day3 F: 掛け算は楽しい
ACPC 2017 Day3 F: 掛け算は楽しい
 
ACPC 2017 Day3 D: 優柔不断
ACPC 2017 Day3 D: 優柔不断ACPC 2017 Day3 D: 優柔不断
ACPC 2017 Day3 D: 優柔不断
 
ACPC 2019 Day3 G: Restricted DFS
ACPC 2019 Day3 G: Restricted DFSACPC 2019 Day3 G: Restricted DFS
ACPC 2019 Day3 G: Restricted DFS
 
ACPC 2019 Day3 F: 部分文字列分解
ACPC 2019 Day3 F: 部分文字列分解ACPC 2019 Day3 F: 部分文字列分解
ACPC 2019 Day3 F: 部分文字列分解
 
ACPC 2019 Day3 E: 総和の切り取り
ACPC 2019 Day3 E: 総和の切り取りACPC 2019 Day3 E: 総和の切り取り
ACPC 2019 Day3 E: 総和の切り取り
 
ACPC 2019 Day3 B: パフェ
ACPC 2019 Day3 B: パフェACPC 2019 Day3 B: パフェ
ACPC 2019 Day3 B: パフェ
 
ACPC 2019 Day3 A: 間違い探し
ACPC 2019 Day3 A: 間違い探しACPC 2019 Day3 A: 間違い探し
ACPC 2019 Day3 A: 間違い探し
 
HUPC 2019 Day2 G: 木
HUPC 2019 Day2 G: 木HUPC 2019 Day2 G: 木
HUPC 2019 Day2 G: 木
 
HUPC 2019 Day2 E: ジャム
HUPC 2019 Day2 E: ジャムHUPC 2019 Day2 E: ジャム
HUPC 2019 Day2 E: ジャム
 
HUPC 2019 Day2 H: Revenge of UMG
HUPC 2019 Day2 H: Revenge of UMGHUPC 2019 Day2 H: Revenge of UMG
HUPC 2019 Day2 H: Revenge of UMG
 
HUPC 2019 Day2 F: MOD Rush
HUPC 2019 Day2 F: MOD RushHUPC 2019 Day2 F: MOD Rush
HUPC 2019 Day2 F: MOD Rush
 
HUPC 2019 Day2 C: 串刺し
HUPC 2019 Day2 C: 串刺しHUPC 2019 Day2 C: 串刺し
HUPC 2019 Day2 C: 串刺し
 
HUPC 2019 Day1 F: グリッドの番号
HUPC 2019 Day1 F: グリッドの番号HUPC 2019 Day1 F: グリッドの番号
HUPC 2019 Day1 F: グリッドの番号
 
HUPC 2019 Day1 E: 最短経路の復元
HUPC 2019 Day1 E: 最短経路の復元HUPC 2019 Day1 E: 最短経路の復元
HUPC 2019 Day1 E: 最短経路の復元
 
HUPC 2019 Day1 D: 貪欲が最適?
HUPC 2019 Day1 D: 貪欲が最適?HUPC 2019 Day1 D: 貪欲が最適?
HUPC 2019 Day1 D: 貪欲が最適?
 
HUPC 2019 Day1 C: 短絡評価
HUPC 2019 Day1 C: 短絡評価HUPC 2019 Day1 C: 短絡評価
HUPC 2019 Day1 C: 短絡評価
 
HUPC 2019 Day1 B: 自身の 2 倍
HUPC 2019 Day1 B: 自身の 2 倍HUPC 2019 Day1 B: 自身の 2 倍
HUPC 2019 Day1 B: 自身の 2 倍
 
HUPC 2019 Day1 A: four tea
HUPC 2019 Day1 A: four teaHUPC 2019 Day1 A: four tea
HUPC 2019 Day1 A: four tea
 
Convex Hull Trick
Convex Hull TrickConvex Hull Trick
Convex Hull Trick
 

Recently uploaded

Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Vladimir Iglovikov, Ph.D.
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
James Anderson
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
Neo4j
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...
ThomasParaiso2
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
nkrafacyberclub
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 

Recently uploaded (20)

Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 

Kika

  • 2. ● ! ● ! ● ! ● ! ● ! ● ! ●
  • 4. ● C++ STL complex ! ◦ ! ● typedef complex<double> Point;! ◦ ! ● x real() y imag() ! ◦ a(x,y) ! ● Point a;! ● a.real() = x; a.imag() = y;! ◦ ! ● x: y: a(x,y) O
  • 6. complex ● ! ◦ complex ! ● ! struct Point{! double x,y;! Point(double a, double b){ x = a; y = b; }! };
  • 7. ● a,b a-b ! ◦ double dis(Point a, Point b){ return abs(a-b); } b(xb,yb) a(xa,ya)
  • 10. ● = |a| * |b| * sinθ
 = |b| * |b xa |
 = × ! ● = × / 2
 = / 2 10    θ
  • 11. ● 2 a,b c ! ● ccw 11 a b
  • 12. ccw int ccw(Point a, Point b, Point c){
 if(cross(b-a,c-a)>EPS)return 1;
 if(cross(b-a,c-a)<-EPS)return -1;
 if(dot(b-a,c-a)<-EPS)return 2;
 if(abs(b-a)+EPS<abs(c-a)return -2;
 return 0;
 } 12 a b
  • 13. : AOJ0035 Is It Convex? ● ! ● 13
  • 14. ● 2 ! ● 2 ! ◦ typedef pair<Point, Point> Line;! ● a b a b ab ab
  • 16. ● ab c a,b c ! ● a b c a b c
  • 17. ● a : ∠BAC > 90°! ● b : ∠ABC > 90°! ● : ! ∠BAC <= 90° ABC <= 90°! ● cosθ(= ) a b c a b c
  • 18. double seg_to_point_dis(Line l, Point p){! Point a = l.first, b = l.second, c = p;! if(dot(b-a,c-a)<EPS)return abs(c-a);! if(dot(a-b,c-b)<EPS)return abs(c-b);! return line_to_point_dis(l,p);! } a b c a b c
  • 19. ● ! double seg_to_seg_dis(Line a, Line b){! double res = seg_to_point_dis(a, b.first);! res = min(res, set_to_point_dis(a, b.second) );! res = min(res, set_to_point_dis(b, a.first) );! res = min(res, set_to_point_dis(b, a.second) );! return res;! }
  • 20. ● a b ! ◦ a 2 b ! ◦ b 2 a ! ● a b a b
  • 21. ● a,b ! ● b 2 a ! ● a 2 b ! ● ccw     α -β b1 b2
  • 22. bool is_cross(Line a, Line b){! if(ccw(a.first,a.second,b.first)*! ccw(a.first,a.second,b.second) <= 0 && ccw(b.first,b.second,a.first)*! ccw(b.first,b.second,a.second) <= 0){! return true;! }! return false;! }
  • 23. : AOJ2351 Closest Segment Pair ● N ! ● ! ● 2 ≦ N ≦ 105 ! ● 0 ≦ xi,yi ≦ 100 23
  • 24.     b1 b2 cp ● a , b ! ● a ! ●
  • 25. Point cross_point(Line a, Line b){
 double d1 = cross(b.second - b.first,
 b.first - a.first);
 double d2 = cross(b.second - b.first,
 a.second - a.first);
 return a.first + (a.second - a.first) * d1/d2;
 } 25     b1 b2 cp d1 = |b2-b1| * |b1-a1| * sinx! = |b2-b1| * |o1-a1|! d2 = |b2-b1| * |a1-a1| * siny! = |b2-b1| * |o2-a1|! ! d1/d2 = |o1-a1| / |o2-a1|! = |cp-a1| / |a1-a1| o1 o2
  • 26. : AOJ0187 Stoning Fortune ● 3 3 ! ● 3 ! ● -1000 ≦ xi,yi ≦ 1000 26