Language
C++
Compiler
gcc 11.1.0
Options
Warnings
Boost 1.78.0
Compiler Default
no pedantic
$ g++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.78.0-gcc-11.1.0/include import matplotlib.pyplot as plt
input = [
[[0,0],[0,200]],
[[0,200],[200,200]],
[[200,200],[200,0]],
[[200,0],[0,0]],
[[20,20],[80,20]],
[[80,20],[80,180]],
[[80,180],[20,180]],
[[20,180],[20,20]],
[[120,20],[180,20]],
[[180,20],[180,180]],
[[180,180],[120,180]],
[[120,180],[120,20]],
]
for p1, p2 in input:
plt.plot([p1[0], p2[0]], [p1[1], p2[1]], color='black', ls='-', marker='o', ms=2)
output = [
[[11,11],[0,0]],
[[11,188],[0,200]],
[[11,11],[10,20]],
[[10,180],[10,20]],
[[11,188],[10,180]],
[[50,50],[20,20]],
[[50,150],[20,180]],
[[20,10],[11,11]],
[[20,190],[11,188]],
[[80,10],[20,10]],
[[80,190],[20,190]],
[[50,50],[80,20]],
[[50,150],[50,50]],
[[80,180],[50,150]],
[[100,20],[80,10]],
[[100,180],[80,190]],
[[180,100],[100,20]],
[[210,90],[100,20]],
[[100,180],[100,20]],
[[0,180],[100,180]],
[[120,190],[0,180]],
[[180,10],[-9223372036854775808,-9223372036854775808]],
[[210,90],[120,180]],
[[180,190],[120,190]],
[[190,30],[180,20]],
[[188,11],[180,10]],
[[200,180],[180,190]],
[[188,11],[200,0]],
[[190,20],[188,11]],
[[190,30],[190,20]],
[[0,200],[190,30]],
[[268,111],[200,180]],
[[180,90],[210,90]],
[[268,111],[180,90]],
[[-9223372036854775808,-9223372036854775808],[268,111]],
[[0,200],[-9223372036854775808,-9223372036854775808]],
]
for p1, p2 in output:
plt.plot([p1[0], p2[0]], [p1[1], p2[1]], color='orange', ls='-', marker='o', ms=2)
plt.show()
Exit Code:
0