上一页 1 ··· 6 7 8 9 10 11 12 13 下一页
摘要: 原题链接 题意:斯努克站在一个二维平面上。在一次操作中,他可以向 \(x\) 轴正方向或是 \(y\) 轴正方向移动一步。定义函数 \(f(r,c)\) 为通过上述操作,斯努克从 \((0,0)\) 走到 \((r,c)\) 的方案总数。现在给定 \(r_1,r_2,c_1\) 和 \(c_2\), 阅读全文
posted @ 2021-03-31 19:14 u_yan 阅读(73) 评论(0) 推荐(0) 编辑
摘要: 原题链接 题意:Akari 有 \(n\) 种不同的花,她可以选择其中一种或多种花做成花束。但是 Akari 不喜欢花的种数恰好为 \(a\) 或 \(b\) 的花束。求出她组合花的合法方案总数,对 \(10^9+7\) 取模。 \(2 \le n \le 10^9\) \(1 \le a < b 阅读全文
posted @ 2021-03-31 16:43 u_yan 阅读(103) 评论(0) 推荐(0) 编辑
摘要: 原题链接 代码: #include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <queue> #include <vect 阅读全文
posted @ 2021-03-30 11:08 u_yan 阅读(32) 评论(0) 推荐(0) 编辑
摘要: 代码: #include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <queue> #include <vector> u 阅读全文
posted @ 2021-03-30 10:13 u_yan 阅读(31) 评论(0) 推荐(0) 编辑
摘要: 原题链接 题意:给定一个奇数 \(n\),将它表示为之多三个的素数之和。 题解:首先了解,哥德巴赫猜想是当 \(n>=4\) 并且 \(n\) 是一个合数时,必然存在两个素数相加。因此,很容易的是,如果判一下,这个数是素数,那么直接就输出这一个数就可以了。然后,引用一句: 利用的关键性质是这样的:对 阅读全文
posted @ 2021-03-29 20:55 u_yan 阅读(54) 评论(0) 推荐(0) 编辑
摘要: 原题链接 题意:给出 \(n<=1e5\) 个旅店的位置,然后人一天最远走 \(L<=1e9\) 长度的路,必须在旅店住一晚上,然后有 \(m <= 1e5\) 个询问,要求出从 \(a\) 旅店到 \(b\) 旅店最少要多少天才能到。 题解:只想到了从 \(n\) 和 \(n-1\) 双指针得出 阅读全文
posted @ 2021-03-29 20:30 u_yan 阅读(60) 评论(0) 推荐(0) 编辑
摘要: 原题链接 题意:给出 \(n <= 1e5\) 个点在二维平面的坐标,并且给出每个点的运动方向,点不会停止,会一直运动下去,速度为1m/s,然后求过了多少时间,\((X_{max}-X_{min})*(Y_{max}-Y_{min})\) 的值最小。 题解:想到了可能是一个凹函数,但是没想到用三分就 阅读全文
posted @ 2021-03-29 20:29 u_yan 阅读(109) 评论(0) 推荐(0) 编辑
摘要: 原题链接 题意:给定一个 \(n\) 个节点的树。现在你拥有 \(k\) 种颜色,你要用这些颜色给树上的每个节点染色,使得任何两个距离不大于2的不同节点所被染的颜色不同。 由于答案可能过大,请将其对 \(10^9+7\) 取模 $$1<=N,K ⇐ 1e5。 题解:由于 \(n,k\) 都是 \(1 阅读全文
posted @ 2021-03-29 16:00 u_yan 阅读(97) 评论(0) 推荐(0) 编辑
摘要: 原题链接 题意:\(A_i = A_{i-1}\times A_x + A_y,B_i = B_{i-1}\times B_x + B_y\),给出$A_0,B_0,A_x,B_x,A_y,B_y$求,\(\sum ^{n-1}_{i = 0}A_i\times B_i\),$0<=n<=1e18$ 阅读全文
posted @ 2021-03-28 10:23 u_yan 阅读(39) 评论(0) 推荐(0) 编辑
摘要: 原题链接 题意:多组输入,输入 \(1 <= n ,m <=1000000000\),\(ans=0\) ,当 \(ans\) 为偶数, \(ans = ans\times 2 + 1\),如果 \(ans\) 为奇数,那么 \(ans = ans\times 2\)。输出 \(ans\)。 题解: 阅读全文
posted @ 2021-03-26 21:24 u_yan 阅读(48) 评论(0) 推荐(0) 编辑
上一页 1 ··· 6 7 8 9 10 11 12 13 下一页