div#730把我打自闭了
害!看开了赛后好好补题才是关键,没有翻不过的高山,只要努力成功会向我走来的!
大家都一样嗷~

A

怎么说呢这道题是压倒我好心情的重要稻草
淦·好题
这道题思维 首先第一个坑你得开long long
第二个不能模拟
wa了3回。。。人间惨案不说了不说了

#include <algorithm>
#include <iostream>
#include <cstring>using namespace std;
typedef long long LL;
LL a, b,k;
LL gcd(LL a, LL b)
{return b?gcd(b, a % b):a;
}int main()
{cin >> k;while (k --){cin >> a >> b;if (a < b) swap(a, b);LL t = a - b;if (t == 0) cout << 0 << " " << 0 << endl;else{cout << a - b << " ";LL a1 = a % (a - b);LL b1 = b % (a - b);if (t - a1 > a1) cout << a1 << endl;else cout << t - a1 << endl;}}return 0;
}

B

B题挺水的 但是阿巴阿巴

#include <algorithm>
#include <iostream>
#include <cstring>using namespace std;const int N = 2e5 + 10;
typedef long long ll;
ll a[N];
int n;int main()
{int t;cin >> t;while (t -- ){cin >> n;ll sum = 0;for (int i = 1; i <= n; i ++ ){cin >> a[i];sum += a[i];}if (n == 1) cout << 0 << endl;else if (sum % n == 0) {cout << 0 << endl;}else {ll k = sum % n;ll r = n - k;cout << (sum % n) * r << endl;}}return 0;
}

C

c题比赛的时候好多人没有读懂题目什么意思
就是和高中学的概率一样的其实
可以用好多方法去完成 这里提供一种dfs

/*
一定要注意
"the item is no longer a valid item for all the further draws"
如果一个概率等于0之后就不在加了一值保持0的状态
*/
#include <algorithm>
#include <iostream>
#include <cstring>using namespace std;double c,m,p,v,t,sum;
const int N = 1e-6;void dfs(double c, double m, double p, double v, double a, int n)
{sum += n * a * p;if (c <= N && m <= N) return;if (c > N) {double x = min(c, v);if (m > N) {//cout << a * c << endl;dfs(c - x, m + x / 2, p + x / 2, v, a * c, n + 1);}else {//cout << a * c << endl;dfs(c - x, 0, p + x, v, a * c, n + 1);}}if (m > N){double x = min(m, v);if (c > N) {//cout << a * m << endl;dfs(c + x / 2, m - x, p + x / 2, v, a * m, n + 1);}else {//cout << a * m << endl;dfs(0, m - x, p + x, v, a * m, n + 1);}}
}int main()
{int t;scanf("%d",&t);while (t -- ){scanf("%lf%lf%lf%lf",&c,&m,&p,&v);sum = 0;dfs(c, m, p, v, 1.0, 1);printf("%.12f\n",sum);}return 0;
}

D

交互题 位运算

#include <algorithm>
#include <iostream>using namespace std;int r, n, k, y;int main()
{int t;cin >> t;while (t -- ){cin >> n >> k;int s = 0;for (int i = 0; i < n; i ++){y = i ^ s;cout << y << endl;fflush(stdout);s = i;cin >> r;if (r == 1) break;}}return 0;
}

div2#730题解相关推荐

  1. codeforces #236 div2 简洁题解

    A:A. Nuts time limit per test 1 second memory limit per test 256 megabytes input standard input outp ...

  2. 游戏盒子_游戏的未来不是盒子

    游戏盒子 Most games today are downloaded and played on smartphones, gaming consoles, and PCs. Network co ...

  3. Codeforces Round #747 (Div. 2)题解

    Codeforces Round #747 (Div. 2)题解 (本博客将持续更新以后每场CF div2的题解,喜欢ACM.OI的小伙伴记得点个关注哟) 昨天夜晚刷网络流刷入迷了,渐渐就忘记了我还要 ...

  4. Codeforces Round #694 (Div. 1 + Div2)(A ~ H,8题全,超高质量题解)【每日亿题】2021/2/1、2/2

    整理的算法模板合集: ACM模板 点我看算法全家桶系列!!! 实际上是一个全新的精炼模板整合计划 目录 [每日亿题]Codeforces Round #694 (Div. 1 + Div2)(A ~ ...

  5. codeforces div2 Not Assigning 题解

    codeforces div2 Not Assigning 题解 原题链接 /* 题意:构造一棵素数树.素数树定义如下: 这颗树中任意一条边 or 任意两条边 权重之和为素数,每条边的权重自己分配. ...

  6. CodeForces Round #730 D1. RPD and Rap Sheet (Easy Version)题解

    Codeforces Round #730 (Div. 2) 题意: t组数据,每组给一个n和k,(easy version里面k=2) 每一次系统会输入一个初始的密码(初始密码是一个在[0,n−1] ...

  7. 2021年洛谷一月月赛(Div1、Div2,6题)全部题解

    整理的算法模板合集: ACM模板 点我看算法全家桶系列!!! 实际上是一个全新的精炼模板整合计划 目录 A.P7285 「EZEC-5」修改数组(思维) B.P7286 「EZEC-5」人赢(贪心) ...

  8. 2017 ACM Arabella Collegiate Programming Contest div2的题,部分题目写个题解

    F. Monkeying Around   维护点在多少个线段上 http://codeforces.com/gym/101350/problem/F 题意:有m个笑话,每个笑话的区间是[L, R], ...

  9. Codeforces ECR50 div2题解

    A:签到 #include<iostream> #include<cstdio> #include<cmath> #include<cstdlib> # ...

最新文章

  1. 3大VR虚拟现实产品PK赛:HTC、Oculus、索尼谁是大哥
  2. Spring Security 4 使用@PreAuthorize,@PostAuthorize, @Secured, EL实现方法安全
  3. boost::graph模块实现资源受限最短路径算法的示例使用
  4. boost::describe模块宏BOOST_DESCRIBE_PP_IS_EMPTY的测试程序
  5. 3.15曝光“山寨”杀毒软件“杀毒三宗罪”
  6. js-cookie 无法设置cookie_php操作 cookie
  7. 基于JAVA+SpringMVC+MYSQL的学生信息管理系统
  8. 2021全国大学生电子设计竞赛论文(智能送药小车(F题))(电赛论文模板)
  9. 使用GSON解析JSON数据
  10. 弘辽科技:掌握淘宝直通车的工作原理很有必要!其核心是什么?
  11. Excel的统计字符数
  12. exception1:unicodeescape’ codec can’t decode bytes in position XXX: trun错误解决方案
  13. android模拟器装包,逍遥模拟器如何安装本地应用包apk?
  14. 【分享】优秀外国英文网站
  15. 用AR Engine手部骨骼跟踪能力实现虚拟手表试戴
  16. return的作用,返回函数值和结束程序执行
  17. HTML生成word文档
  18. C++版 - 剑指offer 面试题39:判断平衡二叉树(LeetCode 110. Balanced Binary Tree) 题解
  19. 小米AI实验室入选《麻省理工科技评论》中国“2021人工智能创新研究院”
  20. 理性解析东数西算:“电”在哪里,“算”就在哪里?

热门文章

  1. 什么是boolean 型?
  2. Ubuntu连接本地服务器失败修复
  3. 【MySQL】MySQL中的日期和时间函数有哪些?元宵节杭州灯光烟花秀你去看了吗?
  4. jy-16-T-STORE——陈子枢总结
  5. 工作中使用Hive SQL的几个知识点(建议收藏)
  6. 在Microsoft Excel中带单位的数字如何求和
  7. 《近匠》BugTags,所见即所得的 App 缺陷发现及管理工具
  8. java 语义分析 开源
  9. Unity DOTS技术浅析
  10. NSIS 删除开始菜单中快捷方式的方法(学习八)