brew install mitmproxy
mitmproxy --mode upstream:https://host:port --upstream-auth=user:password
| askdmalksd |
| Demo |
Div2E / Div1C https://codeforces.com/contest/816/problem/E
Given an array C, D, X of length n of positive integers and a integer budget B. You need to sum most number of elements in C such as the sum <= B, but you can optionally apply a coupon D[i] when choosing C[i] so it becomes C[i] - D[i] instead. But in order to be able to apply the coupon for an index i, you need to have used coupon on index x[i].
Type: Div1C https://codeforces.com/contest/1322/problem/C
Given a bipartite graph of n vertices (labelled 1 to N) and m edges. Let L and R be the disjoint set of vertices. Formally, "disjoint" means that there exists no x and y such that x ∈ L and y ∈ R and edge (x, y) exists. Each vertex i has a value c[i].
For all S ∈ L, N(S) is the set of vertices in R adjacent to any vertex in S.
It is advised to use PEP 8 Style Guide.
one, two, three, four, five, size, seven, eight, nine, \
ten, eleven = token.split()| from __future__ import annotations | |
| ''' | |
| Unique way of solving fibonacci number. | |
| By computing Binet's formula using integer operations only. | |
| We do this by representing (1 + √5) and (1 - √5) as generalized tuple | |
| representing the sum of an integer and the coefficient of √5. | |
| All tuples would represent a algebraic field under basic arithmetic (+, -, *, /, and pow). | |
| Below I implement this tuple as `binet` class then implement the | |
| operations as class operators. |
| # A rare scenario: Communicate to a child process that's running an event loop | |
| import asyncio | |
| from asyncio import StreamReader, StreamReaderProtocol | |
| from multiprocessing import Process | |
| import os | |
| class Worker: | |
| def __init__(self): | |
| self.read_fd, self.write_fd = os.pipe() |