Codeforces Round #268 (Div. 2)_html/css_WEB-ITnose

Codeforces Round #268 (Div. 2)

题目链接

A:有的标记掉判断一下即可

B:枚举时间一个个去判断一下即可

C:构造一下,4和5分别手动构造,然后之后每次多2个数字就先相减掉得到1,然后乘上原数字不变,4以下的是绝对构造不出来的

D:贪心,先排序,然后每次twopointer选头尾两个判断能丢进哪个集合,都不行就找一个之前满足的丢进小集合

立即学习“前端免费学习笔记(深入)”;

E:推理,详细见官方题解,大致是推出来后,[x, x + 1e18 – 1]这个区间,每次挪动一个变成[x + 1, x + 1e18],对应的总和就加1,那么只要能求出[1, 1e18]的值,然后在去挪动相应步数得到相应区间即可,计算1-1e18的和推推规律就可以发现了,官方题解上也有公式

代码:

A:

#include #include int n, p, q, vis[105];bool solve() {for (int i = 1; i   
B:

#include #include const int N = 55;int p, q, l, r, ans;int vis[10005], c[N], d[N];bool judge(int t) {for (int i = 0; i   
C:

#include #include #include #include using namespace std;int n;void solve(int n) {if (n % 2 == 0) {printf("1 + 2 = 3");printf("3 + 3 = 6");printf("6 * 4 = 24");for (int i = 5; i   
D:

#include #include #include #include using namespace std;const int N = 100005;int n, a, b;map to;struct Seq {int num, id, to, vis;} s[N];bool cmp(Seq a, Seq b) {return a.num  b || s[st].num + s[ed].num  b) {swap(a, b);flag = 1;}for (int i = 0; i   
E:

#include #include #include using namespace std;typedef long long ll;const ll INF = 1e18;ll a;int main() {scanf("%lld", &a);ll num = INF / 10 % a;num = num * 2 % a;num = num * 9 % a;num = num * 9 % a;num = num * 5 % a;printf("%lld %lld", a - num, a - num + INF - 1);return 0;}

登录后复制

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至253000106@qq.com举报,一经查实,本站将立刻删除。

发布者:PHP中文网,转转请注明出处:https://www.chuangxiangniao.com/p/2839683.html

(0)
上一篇 2025年3月9日 14:00:52
下一篇 2025年3月9日 14:01:04

AD推荐 黄金广告位招租... 更多推荐

相关推荐

发表回复

登录后才能评论