Codeforces Round #747 (Div. 2) Editorial】的更多相关文章

Codeforces Round #747 (Div. 2) A. Consecutive Sum Riddle 思路分析: 一开始想起了那个公式\(l + (l + 1) + - + (r − 1) + r = (l + r)(r - l + 1) / 2\). 然后一看令\(l + r = 1\)最合适,那么就有\(l = r - 1\),一代入就得到\(r = n, l = -n + 1\). 没想通为什么没有一眼看出来. 代码 #include <bits/stdc++.h> #def…
Codeforces Round #590 (Div. 3) Editorial 题目链接 官方题解 不要因为走得太远,就忘记为什么出发! Problem A 题目大意:商店有n件商品,每件商品有不同的价格,找出一个最小的可能值price,使得price * n >= sum,sum指的是原来商品价格的总和. 知识点:模拟 思路:求出sum/n向上取整即可,有两种方法.一是使用ceil()函数,但注意ceil()返回的是向上取整后的浮点数,所以要进行强制类型转换:二是直接向下取整,然后用if语句…
http://codeforces.com/contest/1133/problem/Ctime limit per test 2 secondsmemory limit per test 256 megabytesinputstandard inputoutputstandard output You are a coach at your local university. There are $n$ students under your supervision, the programm…
题目链接 https://codeforces.com/contest/1506/problem/A 原题 1506A - Strange Table Example input 5 1 1 1 2 2 3 3 5 11 100 100 7312 1000000 1000000 1000000000000 output 1 2 9 1174 1000000000000 题解 先竖列竖列地排数字, 找到x所在的位置s1; 再横行横行地排, 找到s1位置的值并输出  ----->  (n为总行数,…
A. Visiting a Friend time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Pig is visiting a friend. Pig's house is located at point 0, and his friend's house is located at point m on an axis. Pi…
被B的0的情况从头卡到尾.导致没看C,心情炸裂又掉分了. A. Pizza Separation time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Students Vasya and Petya are studying at the BSU (Byteland State University). At one of the…
比赛地址 A(水题) 题目链接 题目: 给出指定\(n\),求解出一段区间\([l,r]\)使得\(\sum\limits_{i=l}^ri=n\) 解析: 从点0,1两点作为起点分别向左右延伸长度,每次延伸单位长度时,这段区间和也加1,因此答案为\([1-n,n]\) #include<bits/stdc++.h> using namespace std; int main() { int T; long long t; scanf("%d", &T); whi…
谢天谢地,还好没掉分,还加了8分,(8分再小也是加啊)前期刚开始有点卡,不过在尽力的调整状态之后,还是顺利的将前面的水题过完了,剩下的E2和F题就过不去了,估计是能力问题,自己还是得认真补题啦. E2. Rubik's Cube Coloring (hard version) 这个题是在上一题的基础上出现的,E1的就很简单,一个完全二叉树,每个点都没有染色,求不同染色方案的方案数.显然的是在第一个点的颜色确定后,后面所有点的颜色都只有4种选择,也就是无论父节点选了什么颜色,该节点都有且仅有四种选…
Codeforces Round #713 (Div. 3) Editorial 记录一下自己写的前二题本人比较菜 A. Spy Detected! You are given an array a consisting of n (n≥3) positive integers. It is known that in this array, all the numbers except one are the same (for example, in the array [4,11,4,4]…
Codeforces Round #366 (Div. 2) A I hate that I love that I hate it水题 #I hate that I love that I hate it n = int(raw_input()) s = "" a = ["I hate that ","I love that ", "I hate it","I love it"] for i in ran…