Skip to content

Instantly share code, notes, and snippets.

View gzz2000's full-sized avatar

Zizheng Guo gzz2000

View GitHub Profile
@gzz2000
gzz2000 / ip_complement.py
Created May 13, 2025 04:38
IP CIDR Complement
#!/usr/bin/env python3
"""
ip_complement.py计算一组 IPv4 / IPv6 CIDR 的互补网段
用法示例
# 直接在命令行给出网段
python ip_complement.py 10.0.0.0/8 192.168.0.0/16 2001:db8::/32
# 从文件或管道读取,再输出 JSON
cat cidr.txt | python ip_complement.py -j
@gzz2000
gzz2000 / bzoj1494_baoli.cpp
Created May 5, 2017 03:56
BZOJ1494 failing dp
#include <cstdio>
#include <algorithm>
using namespace std;
typedef long long ll;
const ll mod = 65521;
inline ll pow(ll a, ll b) {
ll ret = 1;