高级
实现滑动窗口限流算法
未完成示例
输入
solve()
期望输出
DEV001 滑动窗口(max=5/s): total=20, blocked=15 ts=1748736000.0: in_window=1, allowed=True ts=1748736000.1: in_window=2, allowed=True ts=1748736000.2: in_window=3, allowed=True ts=1748736000.3: in_window=4, allowed=True ts=1748736000.4: in_window=5, allowed=True ts=1748736000.5: in_window=6, allowed=False ts=1748736000.6: in_window=7, allowed=False ts=1748736000.7: in_window=8, allowed=False ts=1748736000.8: in_window=9, allowed=False ts=1748736000.9: in_window=10, allowed=False
👑
升级 VIP
解锁全部题目,畅通无阻地学习
- ✓ 解锁全部训练包所有题目
- ✓ 查看完整参考代码和提示
- ✓ 浏览器内直接运行 Python 代码
- ✓ 自动批改 + 进度追踪
30天
¥18
1年
¥99
2年
¥158
3年
¥199