中级
实现SOV声量占比计算
未完成
中级参考
代码结构已给出,请填写 ____ 处
def solve():
import random; random.seed(____)
campaigns = [{'____':'____','____':random.randint(____,____)},{'____':'____','____':random.randint(____,____)},{'____':'____','____':random.randint(____,____)},{'____':'____','____':random.randint(____,____)}]
total = sum(____)
def sov(____): return round(____) if total>____ else ____
print("____"+str(____)+"____")
for c in campaigns:
s = sov(____)
print("____"+c['____']+"____"+str(____)+"____"+str(____)+"____")
print("____"+str(round(sum(sov(____) for c in campaigns),____))+"____")
示例
输入
solve()
期望输出
SOV calculation (total=904): CMP-0001: imps=306 SOV=33.85% CMP-0002: imps=294 SOV=32.52% CMP-0003: imps=101 SOV=11.17% CMP-0004: imps=203 SOV=22.46% SOV sum: 100.0% (~100%)
👑
升级 VIP
解锁全部题目,畅通无阻地学习
- ✓ 解锁全部训练包所有题目
- ✓ 查看完整参考代码和提示
- ✓ 浏览器内直接运行 Python 代码
- ✓ 自动批改 + 进度追踪
30天
¥18
1年
¥99
2年
¥158
3年
¥199