题意:给你一个零一矩阵,q次询问,每次给你两个长宽相同的子矩阵,问你它们是恰好有一位不同,还是完全相同,还是有多于一位不同. 对每行分别哈希,先一行一行地尝试匹配,如果恰好发现有一行无法对应,再对那一行内部进行暴力找出那一行内部有几位不同即可. #include<cstdio> using namespace std; typedef unsigned long long ull; int n,m,q; char a[1005][1005]; ull b[1005][1005],pw[1005…
题意:You are given an array A of N non-negative integers and an integer M. Find the number of pair(i,j) such that 1≤i≤j≤N and min(Ai,Ai+1,...,Aj)⋅(Ai⊕Ai+1⊕...⊕Aj)≤M. 先用把数字从小到大依次插入,用个set预处理出每个最小值控制的子区间的范围,对于大小相同的数,靠左的数优先. 然后对于每个子区间,最小值将它划分成左右两段,枚举较短的那段,…
题意:有n瓶药剂,其中只有一瓶药剂有毒.让你用最少的小白鼠试出哪瓶有毒.你只有一次给任意只小白鼠各喂食任意种类药剂的机会. m只老鼠就能对应2^m种“生死状态”的组合,给每种状态分配一个种类的药剂,然后给每只老鼠喂食“如果它在这种药剂对应的生死状态下死去”的所有药剂,就可以根据发生的死亡情况,分辨出哪瓶药剂有毒. 比如老鼠数有3只. 000 1 001 2 010 3 100 4 110 5 011 6 101 7 111 8 给一号鼠喂4578 给二号鼠3568 给三号鼠2678. 所以答案为…
地址:http://acm.uestc.edu.cn/#/problem/show/1567 题目: Jermutat1on Time Limit: 3000/1000MS (Java/Others)     Memory Limit: 65535/65535KB (Java/Others) Submit Status You are given two numbers nn and kk. You are required to construct a permutation p1,p2,..…
地址:http://acm.uestc.edu.cn/#/problem/show/1554 题目: C0ins Time Limit: 3000/1000MS (Java/Others)     Memory Limit: 65535/65535KB (Java/Others) There are infinite coins with values 1,2,5,101,2,5,10. What's the minimum numbers of coins should be picked t…
地址:http://acm.uestc.edu.cn/#/problem/show/1559 题目: B0n0 Path Time Limit: 1500/500MS (Java/Others)     Memory Limit: 65535/65535KB (Java/Others) There is a country with NN cities, there are roads between some pairs of cities. For every pair of cities,…
地址:http://acm.uestc.edu.cn/#/problem/show/1565 题目: Kidd1ng Me? Time Limit: 3000/1000MS (Java/Others)     Memory Limit: 65535/65535KB (Java/Others) Submit Status There are 1010 tests. For the ithith test, you should output ii. Input No input. Output F…
地址:http://acm.uestc.edu.cn/#/problem/show/1557 题目: Minimum C0st Time Limit: 3000/1000MS (Java/Others)     Memory Limit: 65535/65535KB (Java/Others) There are NN numbers where the ithith is AiAi. In order to make the sum of them changed to SS, you can…
心情不好来写博客. 为了满足ykk想要气球的愿望,NicoDafaGood.Achen和我成功去神大耍了一圈. 因为队名一开始是LargeDumpling应援会,然后队名被和谐,变成了学校的名字,顿时紧张无比,感觉要丢人还要把学校带上了 或许,这5个小时还是蛮愉快的. 最先A掉的题是G题,Bravo 签到题,比较暴力,代码很少,我很快就写完了,结果被卡了常,然后加register就过了. 第二个A掉的题是D题,Echo 我们看到有很多队都过了这道题,但是我们三个都看不懂这道题,我不忍心弃这个题,…
地址:http://acm.uestc.edu.cn/#/problem/show/1564 题目: G - GC?(X,Y) Time Limit: 3000/1000MS (Java/Others)     Memory Limit: 131071/131071KB (Java/Others) One positive integer can be represented by the product of some prime numbers. Sort the prime numbers…