agc015F Kenus the Ancient Greek】的更多相关文章

题意 题目链接 $Q$组询问,每次给出$[x, y]$,定义$f(x, y)$为计算$(x, y)$的最大公约数需要的步数,设$i \leqslant x, j \leqslant y$,求$max(f(i, j))$,以及$max(f(i, j))$不同的数对$(i, j)$的个数 Sol 结论题Orz 设$f(x, y)$表示$(x, y)$辗转相除需要的步数,$fib(i)$表示第$i$个斐波那契数 常识:$f(fib[i], fib[i+1]) = i$. 定义一个数对是“好的”,当且仅…
题意: 有$Q$次询问,每次给定$X_i$和$Y_i$,求对于$1\leq x \leq X_i , 1 \leq y \leq Y_i$,$(x,y)$进行辗转相除法的步数的最大值以及取到最大值的方案数. 步数定义如下:$(a,b)$和$(b,a)$步数相同:$(0,a)$步数为0:如果$a \leq b$,$(a,b)$的步数为$(b \% a,a)$的步数+1. $Q \leq 3*10^5 , X_i,Y_i \leq 10^{18}$. 这种题我一看就懵了,明显要推什么结论,但是我怎么…
题目链接 AtCoder:https://agc015.contest.atcoder.jp/tasks/agc015_f 洛谷:https://www.luogu.org/problemnew/show/AT2384 Solution 神仙结论题...窝只会打表找规律... 我们定义\(f(i,j)\)表示\((i,j)\)的\(\rm Euclidean\ step\ count\),也就是走多少步那个玩意. 定义\(Fib(n)​\)表示斐波那契数列第\(n​\)项,其中\(Fib(0)=…
洛谷题面传送门 & Atcoder 题面传送门 一道难度 Au 的 AGC F,虽然看过题解之后感觉并不复杂,但放在现场确实挺有挑战性的. 首先第一问很简单,只要每次尽量让"辗转相除"变为"辗转相减"即可,具体构造就是 \((F_k,F_{k+1})\),其中 \(F_i\) 为斐波那契数列第 \(i\) 项,\(F_0=F_1=1\),也就是说最终的答案即为最大的 \(k\) 满足 \(F_{k-1}\le X\) 且 \(F_k\le Y\)(不妨假设…
争取三天做完一套吧,太简单的就写一句话题解吧(其实也没多少会做的). 自己做出来的在前面用*标记 agc007 *A - Shik and Stone 暴力dfs即可,直接判断个数 *B - Construct Sequences https://www.cnblogs.com/zwfymqz/p/9706027.html C - Pushing Balls https://www.cnblogs.com/zwfymqz/p/9707414.html agc015 *A - A+...+B Pr…
A&G¥C015 A A+...+B Problem 正常A+B我还是会的,但是又加了个省略号就不会了/kk B Evilator 不会 C Nuske vs Phantom Thnook 以为是神仙题 因为保证了是棵树直接点-边即可 D A or...or B Problem 开始自闭 这题太神仙了 首先\(A,B\)高位相等的可以删掉,删完以后可以找到一个\(T=2^k\)满足\(A<T\leq B\) 考虑T分开的两边 \([A,T)\)只能OR出\([A,T)\)中的数: \([T,…
Atlantis Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 21734   Accepted: 8179 Description There are several ancient Greek texts that contain descriptions of the fabled island Atlantis. Some of these texts even include maps of parts of…
Liberal lawmakers proposed a bill to reduce the cost of medicine for older Americans.自由主义立法者提出一条减少老年美国人的医药费的法案.He is interested in ancient Greek literature.他对古希腊文学感兴趣.She liked to pretend that he loved her more than anyone. (2)她喜欢装成他爱她胜过任何人.The Presi…
Atlantis Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 10599    Accepted Submission(s): 4524 Problem Description There are several ancient Greek texts that contain descriptions of the fabled…
[POJ1151]Atlantis 试题描述 There are several ancient Greek texts that contain descriptions of the fabled island Atlantis. Some of these texts even include maps of parts of the island. But unfortunately, these maps describe different regions of Atlantis.…