我能说我比较傻么!就只能做一道签到题,没办法,我就先写下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…
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…
题意:开始有一个空序列s,一个变量c=0,接着从左往右依次将数组a中的数字放入s的尾部,每放一个数字就检测一次混乱度K,当混乱度k大于M时就清空序列并让c=c+1 K = Bi * Vi(1<=i<=k(序列总长度)的总和),Bi表示序列中第i小的数字,Vi是给定的非递减的数,输出每次加入序列后的变量c 题解:首先发现当没有清空的时候每次向后增加K都不会减小,所以对于不清空来说K一定是非递减的 定义左端点L二分寻找每个右端点R,保证现在R是[L,R]第一个大于M的位置,寻找内部是直接排序暴力…
B 我也不是B 这个题做了一下午,比赛两个小时还是没做出来,比完赛才知道要用一个倍增算法确定区间,然后再二分右端点. 题意:定义一个序列的混乱度为累加和:b[i]*v[i],b[i]为这个序列中第i小的数,v[]数组是给定的.如果当前加进来的数购车的数构成的序列的混乱度大于m,则将当前的序列扔掉,然后将变量C加一,现在给出要加进来的序列的顺序,和v[]数组,求最终C的值. 思路:枚举左端点,二分右端点,暴力判断混乱度与M的关系,如果Me为0,只能一个一个删除,那么二分貌似会将复杂度拉高…
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 #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…
E -- Expected value of the expression DESCRIPTION You are given an expression: A0O1A1O2A2⋯OnAnA0O1A1O2A2⋯OnAn, where Ai(0≤i≤n)Ai(0≤i≤n) represents number, Oi(1≤i≤n)Oi(1≤i≤n) represents operator. There are three operators, &,|,^&,|,^, which means a…
1171 - 这个E大概是垃圾桶捡来的 Time Limit:2s Memory Limit:128MByte Submissions:138Solved:45 DESCRIPTION B君在做 CODE FESTIVAL 2017 qual B 遇到了这样的一道题目 http://code-festival-2017-qualb.contest.atcoder.jp/tasks/code_festival_2017_qualb_f 于是B君决定出一个加强版 输入一个字符串,将他重新排列,使得重…
1149 - Buildings Time Limit:2s Memory Limit:128MByte Submissions:588Solved:151 DESCRIPTION There are nn buildings lined up, and the height of the ii-th house is hihi. An inteval [l,r][l,r](l≤r)(l≤r) is harmonious if and only if max(hl,…,hr)−min(hl,…,…
A -- A simple math problem Time Limit:2s Memory Limit:128MByte Submissions:1599Solved:270 DESCRIPTION You have a sequence anan, which satisfies: Now you should find the value of ⌊10an⌋⌊10an⌋. INPUT The input includes multiple test cases. The number o…
http://www.ifrog.cc/acm/problem/1097?contest=1013&no=1 //LIS的高端写法 #include <iostream> #include <cstdio> #include <cstring> #include <cassert> #include <algorithm> using namespace std; ]; ]; int n, x; int main() { while (s…