Baidu Ball(y) = x
Baidu:
用天平(只能比较,不能称重)从一堆小球中找出其中唯一一个较轻的,
使用x次天平 最多可以从y个小球中找出较轻的那个,求y与x的关系式。
set Ball(y) = x, we could get the following relation:
Ball(1) = 0;
Ball(2) = 1;
Ball(3) = 1;
Ball(4) = 2;
Ball(5) = 2;
Ball(6) = 2;
Ball(7) = 2;
Ball(8) = 2;
Ball(9) = 2;
Ball(10) = 3;
....
Ball(14) = 3;
set j is the second-max factor of y, as for number 28,
all the factors are 1, 2, 4, 7, 14, 28. so, j = 14.
set i is times number for i*j = y,
I get a relation between y and x: Ball(y) = (i/2) + Ball(j);
if y is a prime number, as 17, and its factors are 1 and itself, 17.
Ball(y) = Ball(y-1);
conclusion:
set j is the second-max factor of y and i*j = y;
if(j == 1) j = y-1; /* y is a prime number */
Ball(y) = (i/2) + Ball(j)
This opinion is out of full validation and test.
is it right?
用天平(只能比较,不能称重)从一堆小球中找出其中唯一一个较轻的,
使用x次天平 最多可以从y个小球中找出较轻的那个,求y与x的关系式。
set Ball(y) = x, we could get the following relation:
Ball(1) = 0;
Ball(2) = 1;
Ball(3) = 1;
Ball(4) = 2;
Ball(5) = 2;
Ball(6) = 2;
Ball(7) = 2;
Ball(8) = 2;
Ball(9) = 2;
Ball(10) = 3;
....
Ball(14) = 3;
set j is the second-max factor of y, as for number 28,
all the factors are 1, 2, 4, 7, 14, 28. so, j = 14.
set i is times number for i*j = y,
I get a relation between y and x: Ball(y) = (i/2) + Ball(j);
if y is a prime number, as 17, and its factors are 1 and itself, 17.
Ball(y) = Ball(y-1);
conclusion:
set j is the second-max factor of y and i*j = y;
if(j == 1) j = y-1; /* y is a prime number */
Ball(y) = (i/2) + Ball(j)
This opinion is out of full validation and test.
is it right?
...全文
相关推荐
HTML满屏飘字代码(完整代码)
HTML语言实现满屏飘字的完整代码。
【Python】【爱情代码】巧用Python实现满屏飘字表白代码(抖音同款)
要求用Python实现满屏飘字表白,且文字可变动,营造浪漫氛围~
2020级C语言大作业 - 小球进框
分享20级同学大一上学期用C语言(及少量C++)实现的小球进框游戏。由于同学们刚学了三个月的编程,实现还不够完善,工程代码、图片音乐素材可以从百度网盘下载:链接:https://pan.baidu.com/s/1gcjDdn8HY373TcUSyrdC7Q 提取码:7q33 1 设计思路该程序功能的主体设计参考了网页小游戏“炮弹进框”(Cannon Strike),通过C语言编程进行实现。其中应用...
Microsoft.WinDbg-1.2610.1001.0-x64
Microsoft.WinDbg-1.2610.1001.0-x64
Claude 代码超强能力:核心技能库
Superpowers 是一套面向你的编码智能体的完整软件开发方法论,由一组可组合技能和若干初始指令构建而成,用以确保智能体真正使用这些技能。


