题目链接:https://vjudge.net/problem/Gym-102460E 思路:求: 题目当中给了一段伪代码算法,仔细一看发现它是不会记录负数情况,所以与正确答案会有误差,现在题目给定K误差大小和L该数组的长度(注意L要小于2000,不然不符合上面的式子).那么我门假设a[1]=-1, 构造l=1999,那么假算法的结果为1998*(a[2]+a[3]+...+a[n]),正确答案为1999*(a[2]+a[3]+...+a[n]-1),因为假算法比正确答案小K,那么1998*(a…
题目链接  ECL-Final 2017 Problem D 题意  给定$2*10^{5}$组询问,每个询问求$l$到$r$之间有多少个符合条件的数 如果一个数小于等于$10^{15}$, 并且能被分割成一个至少有$3$项的递增等比数列(公比可以不为整数) 那么这个数是符合条件的. 比赛的时候我大概觉得这应该不是数位DP,是一个比较trick的枚举题. 但是我总感觉哪个地方不太对,或者说是没有写这道题的意识,一直瘫在那里. 今天AC了这个题之后真的后悔莫及,但是一点用都没有. 从至少有$3$项…
C. Sequence Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100114 Description Integer sequences are very interesting mathematical objects. Let us examine a sequence generated with the use of two operations: doubling and “digit…
之前几乎没写过什么这种几何的计算题.在众多大佬的博客下终于记起来了当时的公式.嘚赶快补计算几何和概率论的坑了... 这题的要求,在对两圆相交的板子略做修改后,很容易实现.这里直接给出代码.重点的部分有:两圆在相离(或外交)时输出第一个圆的面积.内涵(或内切)则需要分类讨论,是羊的圈大.还是狼的圈大.以下是代码: #include<iostream> #include<cmath> #include<stdio.h> using namespace std; int ma…
\(\mathcal{Description}\)   Link.   求长度为 \(n\),值域为 \([1,m]\) 的整数序列 \(\lang a_n\rang\) 的个数,满足 \(\not\exist i\in[1,n),~\max_{j=1}^i\{a_j\}=\min_{j=i+1}^n\{a_j\}\),答案对大素数 \(p\) 取模.   \(n\le400\),\(m\le10^8\). \(\mathcal{Solution}\)   前几天刚胡了一个 "DP and DP…
 Gym 101047M Removing coins in Kem Kadrãn Time Limit:2000MS     Memory Limit:65536KB     64bit IO Format:%I64d & %I64u Practice Description standard input/output Andréh and his friend Andréas are board-game aficionados. They know many of their friend…
 Gym 101047B  Renzo and the palindromic decoration Time Limit:2000MS     Memory Limit:65536KB     64bit IO Format:%I64d & %I64u Practice Description standard input/output At the ruins of Wat Phra Si Sanphet (วดพระศรสรรเพชญ), one can find famous inscr…
Crossings Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100463 Description Given a permutation P of {0, 1, ..., n − 1}, we define the crossing number of it as follows. Write the sequence 0, 1, 2, . . . , n − 1 from left to ri…
Problem J. Triatrip Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100342/attachments Description The travel agency “Four Russians” is offering the new service for their clients. Unlike other agencies that only suggest one-way…
G. FacePalm Accounting Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100513/problem/G Description An owner of a small company FacePalm has recently learned that the city authorities plan to offer to small businesses to partic…