C. Efim and Strange Grade Efim just received his grade for the last test. He studies in a special school and his grade can be equal to any positive decimal fraction. First he got disappointed, as he expected a way more pleasant result. Then, he devel…
Problem - A Tomorrow is a difficult day for Polycarp: he has to attend \(a\) lectures and \(b\) practical classes at the university! Since Polycarp is a diligent student, he is going to attend all of them. While preparing for the university, Polycarp…
题目大意 有一个无限长的数字序列,其组成为1 1 2 1 2 3 1.......1 2 ... n...,即重复的1~1,1~2....1~n,给你一个\(k\),求第\(k(k<=10^{18})\)个数字是什么. 思路 设\(a[i]\)为该数到达\(i\)的长度,\(b[i]\)为第\(i\)个数那一块的长度,\(\sum b[i]=a[i]\),发现\([10^i,10^{i+1})\)的数长度均为\(i+1\),那么在这一段中\(b[i]\)都是一个等差数列,而计算\(a[i]\)就…
Codeforces Round #373 (Div. 2) A. Vitya in the Countryside 这回做的好差啊,a想不到被hack的数据,b又没有想到正确的思维 = = [题目链接]A. Vitya in the Countryside [题目类型]模拟 &题意: 一个月30天,月亮的大小分别是上面所说的规律,求输入的下一天是变大还是变小 &题解: 我想的是首先n==1的时候,我想的是一定-1,但这样是错的,因为当那一个数是15或0时,那么答案就不是-1了. 最后,只…
Codeforces Round #373 (Div. 1) A. Efim and Strange Grade 题意 给一个长为\(n(n \le 2 \times 10^5)\)的小数,每次可以选择某位小数进行四舍五入,最多做\(t(t \le 10^9)\)次. 求最大的数. 思路 每次必然找小数部分能进行四舍五入的最高位,并且四舍五入的位置是递增的. 注意:99.5这样的数据,最高位会进位. 代码 A. Efim and Strange Grade C. Sasha and Array…
[题解]Codeforces 961G Partitions cf961G 好题啊哭了,但是如果没有不小心看了一下pdf后面一页的提示根本想不到 题意 已知\(U=\{w_i\}\),求: \[ \sum _{S}\sum_{s\in S}|s|\sum_{w \in s} w, S是U的一个k划分 \] 转换1 考虑这个\(|s|\)有点麻烦,稍微思考一下可以发现,我们最后的答案和\(w_i\)的分布没有关系,他们的贡献系数是一样的.答案只和他们的和有关. 转换2 考虑定位某个\(w_i\)对…
A. Crazy Computer time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output ZS the Coder is coding on a crazy computer. If you don't type in a word for a c consecutive seconds, everything you typed…
B. Complete the Word time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output ZS the Coder loves to read the dictionary. He thinks that a word is nice if there exists a substring (contiguous segmen…
Codeforces Round #551 (Div. 2) 算是放弃颓废决定好好打比赛好好刷题的开始吧 A. Serval and Bus 处理每个巴士最早到站且大于t的时间 #include <bits/stdc++.h> #define fi first #define se second #define pii pair<int,int> #define mp make_pair #define pb push_back #define space putchar(' ')…
门户:Codeforces Round #277 (Div. 2) 486A. Calculating Function 裸公式= = #include <cstdio> #include <cstring> #include <algorithm> using namespace std ; typedef long long LL ; LL n ; int main () { while ( ~scanf ( "%I64d" , &n )…