Educational Codeforces Round 71】的更多相关文章

Educational Codeforces Round 71 (Rated for Div. 2)-F. Remainder Problem-技巧分块 [Problem Description] ​ 初始\([1,500000]\)都为0,后续有两种操作: ​ \(1\).将\(a[x]\)的值加上\(y\). ​ \(2\).求所有满足\(i\ mod\ x=y\)的\(a[i]\)的和. [Solution] ​ 具体做法就是,对于前\(\sqrt{500000}=708\)个数,定义\(…
Educational Codeforces Round 71 (Rated for Div. 2)-E. XOR Guessing-交互题 [Problem Description] ​ 总共两次询问,每次询问给出\(100\)个不同的数,评测系统对于每次询问,随机从\(100\)个数中选择一个数\(a\),返回\(x\oplus a\).让你通过两次返回的值猜出\(x\)值是多少.要求两次询问的\(200\)个数互不相同,且题目保证\(x\)值固定不变. [Solution] ​ 题目要求所…
一道容斥题 如果直接做就是找到所有出现过递减的不同排列,当时硬钢到自闭,然后在凯妹毁人不倦的教导下想到可以容斥做,就是:所有的排列设为a,只考虑第一个非递减设为b,第二个非递减设为c+两个都非递减的情况设为d,那么正解就是a-b-c+d; 然后在text4上wa了无数次,为什么全开long long还会出现负数结果呢,这时候一位美男子(没错又是凯妹)提示:因为我们的结果是mod998244353,如果a%998244353后是0,那么a-b-c+d就会出现负数,而答案必为正,故wa. 注意到结果…
https://www.cnblogs.com/31415926535x/p/11460682.html 上午没课,做一套题,,练一下手感和思维,,教育场的71 ,,前两到没啥,,后面就做的磕磕巴巴的,,,有想法但是不敢实现,,自我否定,,没了思路就只能官方题解,,发现其实都很简单,,,思维场把,,,, A There Are Two Types Of Burgers 贪心就完事了,,推出公式不知道怎么证明是最优的,,,(敲错变量还wale一发emmm #include <bits/stdc++…
E. XOR Guessing time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output This is an interactive problem. Remember to flush your output while communicating with the testing program. You may use fflush(st…
题目:http://codeforces.com/contest/1207/problem/B   B. Square Filling time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output You are given two matrices A and B. Each matrix contains exactly n rows a…
题目:http://codeforces.com/contest/1207/problem/C   C. Gas Pipeline time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output You are responsible for installing a gas pipeline along a road. Let's cons…
传送门 A.There Are Two Types Of Burgers 签到. B.Square Filling 签到 C.Gas Pipeline 每个位置只有"高.低"两种状态,所以直接根据条件来\(dp\)即可. Code #include <bits/stdc++.h> #define MP make_pair #define INF 0x3f3f3f3f3f3f3f3f using namespace std; typedef long long ll; con…
A. There Are Two Types Of Burgers 题意: 给一些面包,鸡肉,牛肉,你可以做成鸡肉汉堡或者牛肉汉堡并卖掉 一个鸡肉汉堡需要两个面包和一个鸡肉,牛肉汉堡需要两个面包和一个牛肉 求能得到的最多的钱 直接贪心,哪个比较贵就选哪个做,剩下的材料再做另一个 #include<iostream> #include<cstdio> #include<algorithm> #include<cstring> #include<cmath…
引用:https://blog.csdn.net/qq_41879343/article/details/100565031 下面代码写错了,注意要上面这种.查:2  800  0,下面代码就错了. #define IOS ios_base::sync_with_stdio(0); cin.tie(0); #include <cstdio>//sprintf islower isupper #include <cstdlib>//malloc exit strcat itoa sy…