Description For an upcoming programming contest, Edward, the headmaster of Marjar University, is forming a two-man team from N students of his university. Edward knows the skill level of each student. He has found that if two students with skill leve…
Description Edward has an array A with N integers. He defines the beauty of an array as the summation of all distinct integers in the array. Now Edward wants to know the summation of the beauty of all contiguous subarray of the array A. Input There a…
Description Bobo has a balanced parenthesis sequence P=p1 p2…pn of length n and q questions. The i-th question is whether P remains balanced after pai and pbi  swapped. Note that questions are individual so that they have no affect on others. Parenth…
Team Formation For an upcoming programming contest, Edward, the headmaster of Marjar University, is forming a two-man team from N students of his university. Edward knows the skill level of each student. He has found that if two students with skill l…
愉快的校赛翻皮水! 题解 A 温暖的签到,注意用gets #include <map> #include <set> #include <ctime> #include <cmath> #include <queue> #include <stack> #include <vector> #include <string> #include <cstdio> #include <cstdlib…
Bobo has a balanced parenthesis sequence P=p 1 p 2…p n of length n and q questions. The i-th question is whether P remains balanced after p ai and p bi  swapped. Note that questions are individual so that they have no affect on others. Parenthesis se…
Bobo 有一个 n 个点,m 条边的有向无环图(即对于任意点 v,不存在从点 v 开始.点 v 结束的路径). 为了方便,点用 1,2,…,n 编号. 设 count(x,y) 表示点 x 到点 y 不同的路径数量(规定 count(x,x)=0),Bobo 想知道     除以 (10 9+7) 的余数. 其中,a i,b j 是给定的数列.   Input 输入包含不超过 15 组数据. 每组数据的第一行包含两个整数 n,m (1≤n,m≤10 5). 接下来 n 行的第 i 行包含两个整…
给出正整数 n 和 m,统计满足以下条件的正整数对 (a,b) 的数量:       1. 1≤a≤n,1≤b≤m;   2. a×b 是 2016 的倍数.   Input   输入包含不超过 30 组数据.   每组数据包含两个整数 n,m (1≤n,m≤10 9).   Output对于每组数据,输出一个整数表示满足条件的数量.Sample Input 32 63 2016 2016 1000000000 1000000000 Sample Output 1 30576 752314689…
题目传送门 题目大意: 从0出发,每次只能跳到(i*2)%n或者(i*2+1)%n,求字典序最大的哈密顿回路. 思路: 首先n为奇数时无解,先来证明这一点. 先假设n为奇数,若要回到原点,则必定有一步是$a%n=0$,则$a=kn(k为整数)$. 我们先假设a是通过$2x$的方式得到的,即$kn=2*x$,由于此时$n$为奇数,则k必定为偶数,由于$n>x$,所以$k<2$,k又不能等于0,所以此时k无解,a不是通过$s*x$的方法得到的 那么$kn=2*x+1$,k为奇数,则$k=1  ,a…
题目传送门 题意:每天能往存钱罐加任意实数的钱,每天不能多于起那一天放的钱数.如果某一天的钱数恰好等于那天的特价商品,则可以买,求最后的最大快乐值. 思路:先来一段来自出题人的题解: 显然的贪心:如果第$i$天买完,准备在第$j$天买,那么显然最优是在$i+1$到j天放$wi/(j-i)$的钱. 于是假定选择的物品是$k1,k2,k3… $那么必须满足: $a[ki]/(ki-ki-1)<=a[ki-1]/(ki-1-ki-2)$ 令$f[i][j]$表示最后购买的两个物品为i和j,则$f[i]…
传送门:点我 题目很棒,感谢出题验题的大佬们. 细节坑不少,是好事. 还是很菜,继续加油! B: 桃子的生日 时间限制(普通/Java):1000MS/3000MS     内存限制:65536KByte总提交: 344            测试通过: 43 描述 桃子这几天在收集纪念币,总共最多只有N种不同的纪念币,他已经收集了K种不同的纪念币.这不,桃子的生日快到了,他的M个小伙伴们决定送他纪念币,如何送给桃子呢?他们都同意了如下三个规则: 1. 每个人送的纪念币与其他人的都一样多: 2.…
Team Formation Time Limit: 3 Seconds Memory Limit: 131072 KB For an upcoming programming contest, Edward, the headmaster of Marjar University, is forming a two-man team from N students of his university. Edward knows the skill level of each student.…
原题链接 http://acm.csu.edu.cn/OnlineJudge/problem.php?id=1809 Description Bobo has a balanced parenthesis sequence P=p1 p2…pn of length n and q questions. The i-th question is whether P remains balanced after pai and pbi  swapped. Note that questions ar…
第十二届 GOPS 全球运维大会深圳站 会议召开时间:2019年4月12日-13日 会议召开地点:深圳圣淘沙酒店(翡翠店) 会议主办单位:高效运维社区 票务合作伙伴:活动家 会议报名地址:https://www.huodongjia.com/event-1887291715.html 大会为期2天,侧重方向是 AIOps.运维自动化和 DevOps.目前已经有全国各地大公司组团前来参加. 此外还有一些特色专场如:AIOps 场景实践专场.DevOps 最佳实践专场.DevOps 标准认证企业案例…
title: Plumbing the depth of lake 河南省第十届省赛 题目描述: There is a mysterious lake in the north of Tibet. As the sun shines, the surface of the lake is colorful and colorful. The lake was unfathomable in rainy weather.  After the probe,  It has an interesti…
title: Intelligent Parking Building 河南省第十届省赛 tags: [模拟,省赛] 题目描述: There is a new revolution in the parking lot business: the parking  building. The concept is simple: you drive your car into the elevator at the entrance of the building, and the elevat…
四川第十届省赛 A.Angel Beats bitset 题目链接 题解参考:http://www.cnblogs.com/Aragaki/p/9142250.html 考虑用bitset来维护对于所有的\(x\),需要翻转的位置.但是这样来搞的话,很难处理题目的要求. 所以换个角度,考虑翻转哪些位置会影响这一位.我们会发现,如果位置编号为某些数的公倍数,那么就会受到那些位置的影响.进一步深入想,其实会发现可以考虑只翻转某一位需要翻转哪些位置,这样的方案是唯一的. 设\(s[i]\)为只翻转第\…
题目传送门 /* 题意:找出符合 A^B > max (A, B) 的组数: 位运算:异或的性质,1^1=0, 1^0=1, 0^1=1, 0^0=0:与的性质:1^1=1, 1^0=0, 0^1=0, 0^0=0: 假设A < B,一定要满足B的最高位对应A的值是0,这样才可能>B(即0^1=1): 然后比赛时假设A的极限是类似0111111的情况,最后假设有误: 题解是先把每个数最高位(1)的位置统计个数,1<<4 的意思是 000010000: 只要与为0,表示最高位p…
http://acm.zju.edu.cn/onlinejudge/showContestProblem.do?problemId=5494 The 12th Zhejiang Provincial Collegiate Programming Contest - B Team Formation Time Limit: 3 Seconds      Memory Limit: 131072 KB For an upcoming programming contest, Edward, the…
/** Author: Oliver ProblemId: ZOJ3870 Team Formation */ /* 思路 1.异或运算,使用^会爆,想到二进制: 2.我们可以试着从前往后模拟一位一位的^那么只要当前位结果变大便是: 3.一般我们如何利用二进制呢?既然要爆那我们就存1的位置: 4.问题是怎么存,如何用? 5.我之前想的是每个数的每位1都存,但是那样造成的重复计算还没想出怎么避免.看了一下别人的博客,再尝试把每位数的最高位1存起来. 6.想想为什么是存最高位呢: 7.那好,现在是不…
Team Formation Time Limit: 3 Seconds      Memory Limit: 131072 KB For an upcoming programming contest, Edward, the headmaster of Marjar University, is forming a two-man team from N students of his university. Edward knows the skill level of each stud…
Team Formation Time Limit: 3 Seconds      Memory Limit: 131072 KB For an upcoming programming contest, Edward, the headmaster of Marjar University, is forming a two-man team from N students of his university. Edward knows the skill level of each stud…
                                                B - Team Formation Description For an upcoming programming contest, Edward, the headmaster of Marjar University, is forming a two-man team from N students of his university. Edward knows the skill level…
Team Formation Time Limit: 2 Seconds Memory Limit: 131072 KB For an upcoming programming contest, Edward, the headmaster of Marjar University, is forming a two-man team from N students of his university. Edward knows the skill level of each student.…
Demacia of the Ancients Time Limit: 2 Seconds Memory Limit: 65536 KB There is a popular multiplayer online battle arena game called Demacia of the Ancients. There are lots of professional teams playing this game. A team will be approved as Level K if…
Capture the Flag Time Limit: 2 Seconds Memory Limit: 65536 KB Special Judge In computer security, Capture the Flag (CTF) is a computer security competition. CTF contests are usually designed to serve as an educational exercise to give participants ex…
May Day Holiday Time Limit: 2 Seconds Memory Limit: 65536 KB As a university advocating self-learning and work-rest balance, Marjar University has so many days of rest, including holidays and weekends. Each weekend, which consists of Saturday and Sun…
Lunch Time Time Limit: 2 Seconds Memory Limit: 65536 KB The 999th Zhejiang Provincial Collegiate Programming Contest will be held in Marjar University. The canteen of Marjar University is making preparations for this grand competition. The canteen pr…
Beauty of Array Time Limit: 2 Seconds Memory Limit: 65536 KB Edward has an array A with N integers. He defines the beauty of an array as the summation of all distinct integers in the array. Now Edward wants to know the summation of the beauty of all…
Ace of Aces Time Limit: 2 Seconds Memory Limit: 65536 KB There is a mysterious organization called Time-Space Administrative Bureau (TSAB) in the deep universe that we humans have not discovered yet. This year, the TSAB decided to elect an outstandin…