当前位置:网站首页>Daily question 1688 Number of matches in the competition
Daily question 1688 Number of matches in the competition
2022-07-05 05:41:00 【A big pigeon】
topic : The game has n A team , Eliminate half of each round , If n Is odd , So many teams are directly promoted .
Find the total number of games .
Explain :( simulation )
class Solution:
def numberOfMatches(self, n: int) -> int:
res = 0
while n > 1:
res += n//2
n = (n+1) // 2
return res
边栏推荐
- Sword finger offer 05 Replace spaces
- 剑指 Offer 05. 替换空格
- 智慧工地“水电能耗在线监测系统”
- Time complexity and space complexity
- Using HashMap to realize simple cache
- Educational Codeforces Round 107 (Rated for Div. 2) E. Colorings and Dominoes
- A misunderstanding about the console window
- Transform optimization problems into decision-making problems
- 全国中职网络安全B模块之国赛题远程代码执行渗透测试 //PHPstudy的后门漏洞分析
- 注解与反射
猜你喜欢
剑指 Offer 09. 用两个栈实现队列
Brief introduction to tcp/ip protocol stack
Sword finger offer 58 - ii Rotate string left
Support multi-mode polymorphic gbase 8C database continuous innovation and heavy upgrade
CF1637E Best Pair
Time of process
全国中职网络安全B模块之国赛题远程代码执行渗透测试 //PHPstudy的后门漏洞分析
剑指 Offer 05. 替换空格
Sword finger offer 09 Implementing queues with two stacks
EOJ 2021.10 E. XOR tree
随机推荐
剑指 Offer 04. 二维数组中的查找
Little known skills of Task Manager
卷积神经网络——卷积层
Wazuh开源主机安全解决方案的简介与使用体验
The number of enclaves
卷积神经网络简介
Using HashMap to realize simple cache
2022 极术通讯-Arm 虚拟硬件加速物联网软件开发
个人开发的渗透测试工具Satania v1.2更新
kubeadm系列-00-overview
CF1634E Fair Share
Corridor and bridge distribution (csp-s-2021-t1) popular problem solution
[jailhouse article] look mum, no VM exits
AtCoder Grand Contest 013 E - Placing Squares
Codeforces Round #732 (Div. 2) D. AquaMoon and Chess
sync. Interpretation of mutex source code
EOJ 2021.10 E. XOR tree
Time of process
Over fitting and regularization
Haut OJ 1401: praise energy