ICPC Guide#
A collection of lessons and code for ACM ICPC. Similarly to USACO.Guide, ICPCarchive, and several others.
Getting Started#
If you’re new, read the math section, then the C++ and python sections.
If you’re not, idk.
import numpy as np
import matplotlib.pyplot as plt
xy = {}
# Iterative logistic map function
def iterative(x, a):
return a * x * (1 - x)
# Loop over values of 'a' from 1 to 4 with small step size
for a in np.arange(1, 4, 0.0001):
# Start with a random initial condition
temp = iterative(np.random.default_rng().random(), a)
# Iterate 100 times to reach the steady state
for i in range(100):
temp = iterative(temp, a)
# Store the final value for bifurcation diagram
xy[a] = temp
# Plot the bifurcation diagram
plt.plot(xy.keys(), xy.values(), linestyle='None', marker='o', markersize=0.2)
plt.show()