当前位置:网站首页>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
边栏推荐
- Some common problems in the assessment of network engineers: WLAN, BGP, switch
- 全排列的代码 (递归写法)
- [cloud native] record of feign custom configuration of microservices
- CCPC Weihai 2021m eight hundred and ten thousand nine hundred and seventy-five
- Haut OJ 1401: praise energy
- Pointnet++ learning
- Codeforces round 712 (Div. 2) d. 3-coloring (construction)
- 全国中职网络安全B模块之国赛题远程代码执行渗透测试 //PHPstudy的后门漏洞分析
- Solution to game 10 of the personal field
- The number of enclaves
猜你喜欢
随机推荐
Sword finger offer 58 - ii Rotate string left
Bit mask of bit operation
Add level control and logger level control of Solon logging plug-in
The number of enclaves
Maximum number of "balloons"
Little known skills of Task Manager
Simple knapsack, queue and stack with deque
Introduction to convolutional neural network
中职网络安全技能竞赛——广西区赛中间件渗透测试教程文章
Time complexity and space complexity
剑指 Offer 05. 替换空格
Dichotomy, discretization, etc
Reflection summary of Haut OJ freshmen on Wednesday
Sword finger offer 06 Print linked list from beginning to end
Wazuh開源主機安全解决方案的簡介與使用體驗
2020ccpc Qinhuangdao J - Kingdom's power
卷积神经网络简介
剑指 Offer 53 - I. 在排序数组中查找数字 I
Cluster script of data warehouse project
【Jailhouse 文章】Look Mum, no VM Exits