[链接]http://www.ifrog.cc/acm/problem/1161 [题意] 在这里写题意 [题解] 首先x<l肯定无解; 然后,肯定是要选其中的一些数字的. 而且这些数字肯定是大于等于l的. 则我们尽可能多的先选一些l 即x/l个l; 然后剩下rest=x/l-l就用cnt个数字[0..r-l]来填; 且cnt <= x/l; 表示把其中的一些l扩大一点,变成大于l的数字. 也即判断(x/l)*(r-l)是不是大于等于rest的 很巧妙的方法.. 最后整理一下会发现就是判断 设…
可以把每个公式都化简,然后得到要维护的东西就是平方和,和前缀和,两个bit即可 不能cin,超时.IOS后都不行. scanf用lld #include <cstdio> #include <cstdlib> #include <cstring> #include <cmath> #include <algorithm> #define IOS ios::sync_with_stdio(false) using namespace std; #d…
A -- simple math problem Time Limit:2s Memory Limit:128MByte Submissions:1599Solved:270 SAMPLE INPUT 5 20 1314 SAMPLE OUTPUT 5 21 1317 SOLUTION “玲珑杯”ACM比赛 Round #19 题目链接:http://www.ifrog.cc/acm/problem/1145 分析: 这个题解是官方写法,官方代码如下: #include <iostream>…
我能说我比较傻么!就只能做一道签到题,没办法,我就先写下A题的题解&源码吧,日后补上剩余题的题解&源码吧!                                     A -- Niro plays Galaxy Note 7                    Time Limit:1s Memory Limit:128MByte DESCRIPTION Niro, a lovely girl, has bought a Galaxy Note 7 and wants to…
“玲珑杯”ACM比赛 Round #19 Start Time:2017-07-29 14:00:00 End Time:2017-07-29 16:30:00 Refresh Time:2017-07-29 16:42:55 Private B -- Buildings Time Limit:2s Memory Limit:128MByte Submissions:590Solved:151 DESCRIPTION There are nn buildings lined up, and th…
Start Time:2016-08-20 13:00:00 End Time:2016-08-20 18:00:00 Refresh Time:2017-11-12 19:51:52 Public A -- Absolute Defeat Time Limit:2s Memory Limit:64MByte Submissions:394Solved:119 DESCRIPTION Eric has an array of integers a1,a2,...,ana1,a2,...,an.…
“玲珑杯”ACM比赛 Round #18 Start Time:2017-07-15 12:00:00 End Time:2017-07-15 15:46:00 A -- 计算几何你瞎暴力 Time Limit:5s Memory Limit:256MByte Submissions:1764Solved:348 DESCRIPTION 今天HHHH考完了期末考试,他在教学楼里闲逛,他看着教学楼里一间间的教室,于是开始思考: 如果从一个坐标为 (x1,y1,z1)(x1,y1,z1)的教室走到(…
A:DESCRIPTION Eric has an array of integers a1,a2,...,ana1,a2,...,an. Every time, he can choose a contiguous subsequence of length kk and increase every integer in the contiguous subsequence by 11. He wants the minimum value of the array is at least…
手速狗从西安回来一只浑浑噩噩,好不容易迎来一场送饭比赛体验一把河南的优势,结果被高中生狂虐,无缘奖金..我的奖品梦就这样一次次被打破.... A -- Reverse the lights 最后半小时lzq送(抢)来代码,据说只能翻转一次,嗯,于是结合数据优势变成了shabi题,直接暴力模拟找最小值. #define ll long long const ll inf=0x3f3f3f3f3f3f3f3f; ll a[10010]; ll solve(ll n,ll k) { ll i,j,an…
http://www.ifrog.cc/acm/problem/1054 问删除一个字符后的最小循环节是多少. 比赛的时候想不出,不知道怎么暴力. 赛后看了别人代码才晓得.唉,还以为自己字符串还不错,但是变了一点点就不懂了. 1.可以暴力枚举循环节长度i,必要条件是(lenstr - 1) % i == 0.这是必须的,因为必须是倍数,关于约数的个数:(不大) http://vfleaking.blog.163.com/blog/static/174807634201341913040467/…