跳到正文

题解

题解 AT3731 【[ARC088A] Multiple Gift】

UnyieldingTrilobite约 2 分钟
原文
文章信息与版本

文章信息

发布
2020年3月15日
收录
2026年10月14日
更新
2026年11月14日
篇幅
约 2 分钟
获赞
3

版本

  1. v1当前

Update:修了一点排版,重新审核

分析:

首先,这题如果要长度最大,那么首项必然尽量小,即为x。

由于首项是x故每一项都是x的倍数,可以同除以x。

现在就是要求 1,2,…,[yx]1,2,\ldots,[\frac{y}{x}] 中能有多少项。

接着暴力膜你每一项就行了······

上代码,Python3:

C++
x,y=input().split();
k,w=int(y)//int(x),0
while 2**w<=k:w=w+1
print(w)

Over,对于不想搞事的同志,到这里已经没了。

接着来一种高能玩玩······

自然语言编程

更详细的可以戳这里。

然后就是“自然语言”代码······

C++
I have some long integers called x,y;
Let us begin;
Use the way of input(x,y);
I have some long integers called k(y divided by x),w(0),p(1);
While the value of p is less than the value of k plus 1 do{
    Let the value of w be the value of w plus 1;
    Let the value of p be the value of p times 2;
}
Print out w;
Print out '\n';
That is all;
Thank you so much;

英语作文既视感。

代码前加上这些,语言选C++14就好了(滑稽。

真·Over.

祝大家切题愉快!

原文
存档评论1 条抓取于