题意:有n瓶药剂,其中只有一瓶药剂有毒.让你用最少的小白鼠试出哪瓶有毒.你只有一次给任意只小白鼠各喂食任意种类药剂的机会. m只老鼠就能对应2^m种“生死状态”的组合,给每种状态分配一个种类的药剂,然后给每只老鼠喂食“如果它在这种药剂对应的生死状态下死去”的所有药剂,就可以根据发生的死亡情况,分辨出哪瓶药剂有毒. 比如老鼠数有3只. 000 1 001 2 010 3 100 4 110 5 011 6 101 7 111 8 给一号鼠喂4578 给二号鼠3568 给三号鼠2678. 所以答案为…
题意: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预处理出每个最小值控制的子区间的范围,对于大小相同的数,靠左的数优先. 然后对于每个子区间,最小值将它划分成左右两段,枚举较短的那段,…
题意:给你一个零一矩阵,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…
地址: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…
地址: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/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…
地址:http://acm.uestc.edu.cn/#/problem/show/1551 题目: Hesty Str1ng Time Limit: 3000/1000MS (Java/Others)     Memory Limit: 65535/65535KB (Java/Others) A chrysanthemum was painted on the second page, and we tried to use the magic power learned just now.…
地址:http://acm.uestc.edu.cn/#/problem/show/1558 题目: D - Destr0y City Time Limit: 3000/1000MS (Java/Others)     Memory Limit: 65535/65535KB (Java/Others) Alice want to build nn cities on a plane. A city can be regarded as a point. In order to keep comm…
心情不好来写博客. 为了满足ykk想要气球的愿望,NicoDafaGood.Achen和我成功去神大耍了一圈. 因为队名一开始是LargeDumpling应援会,然后队名被和谐,变成了学校的名字,顿时紧张无比,感觉要丢人还要把学校带上了 或许,这5个小时还是蛮愉快的. 最先A掉的题是G题,Bravo 签到题,比较暴力,代码很少,我很快就写完了,结果被卡了常,然后加register就过了. 第二个A掉的题是D题,Echo 我们看到有很多队都过了这道题,但是我们三个都看不懂这道题,我不忍心弃这个题,…
B - Banana Watch Time Limit: 1000/1000MS (Java/Others)     Memory Limit: 262144/262144KB (Java/Others) Submit  Status As a famous technology company, Banana Inc. invents Banana Watch, redefining the watch. While a normal watch has 12 indexes and two…
Problem L Last Blood In many programming contests, special prizes are given to teams who solved a particular problem first. We call the first accepted solution "First Blood". It's an interesting idea to set prizes for "Last Blood". The…
Doki Doki Literature Club Time Limit: 1 Second      Memory Limit: 65536 KB Doki Doki Literature Club! is a visual novel developed by Team Salvato. The protagonist is invited by his childhood friend, Sayori, to join their high school's literature club…
Handshakes Time Limit: 2 Seconds      Memory Limit: 65536 KB Last week, n students participated in the annual programming contest of Marjar University. Students are labeled from 1 to n. They came to the competition area one by one, one after another…
2020-2021 "Orz Panda" Cup Programming Contest 比赛情况 我们一共过了道3题 本场贡献:et3_tsy :过了A,提供了H的关键修改 ​ 1427314831a:尝试写E,可惜没过 ​ Ryker0923 :过了H,I 罚时:H,I各罚了一次 比赛总结 et3_tsy 这场比赛是比较考验基本功的,像CG,需要的知识储备很低,但是场上没有写,说明还是有点问题的. 1427314831a 多注意一些容易导致死循环的细节. Ryker0923 注意…
http://acm.zju.edu.cn/onlinejudge/showContestProblem.do?problemId=5503 The 12th Zhejiang Provincial Collegiate Programming Contest - K Capture the Flag Time Limit: 2 Seconds      Memory Limit: 65536 KB      Special Judge In computer security, Capture…
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…
http://acm.zju.edu.cn/onlinejudge/showContestProblem.do?problemId=5504  The 12th Zhejiang Provincial Collegiate Programming Contest - L Demacia of the Ancients Time Limit: 2 Seconds      Memory Limit: 65536 KB There is a popular multiplayer online ba…
2016 Hunan Province Programming Contest A. 2016 题意 \(1 \le a \le n, 1 \le b \le m\) ,其中\(1 \le n,m \le 10^9\) 求正整数\((a,b)\)对的数量,满足\(ab \% 2016 = 0\) 思路 \(2016=2^53^27\) 根据\(a\)对因子的贡献对\(a\)分类,每种方案数对应\(b\)的数量,即\[\lfloor \frac{m}{\frac{2016}{a}} \rfloor…
Problem H High bridge, low bridge Q: There are one high bridge and one low bridge across the river. The river has flooded twice, why the high bridge is flooded twice but the low bridge is flooded only once? A: Because the lower bridge is so low that…
Problem G Good Teacher I want to be a good teacher, so at least I need to remember all the student names. However, there are too many students, so I failed. It is a shame, so I don't want my students to know this. Whenever I need to call someone, I c…
My birthday is coming up and traditionally I'm serving pie. Not just one pie, no, I have a numberN of them, of various tastes and of various sizes. F of my friends are coming to my party and each of them gets a piece of pie. This should be one piece…
A. Airport Coffee 设$f_i$表示考虑前$i$个咖啡厅,且在$i$处买咖啡的最小时间,通过单调队列优化转移. 时间复杂度$O(n)$. #include<cstdio> const int N=500010; typedef long long ll; const double inf=1e20; ll L,A,B,T,R,lim0,lim1,a[N]; double f[N],val[N]; double dp0=inf; int id0; int pre[N]; int…
2018 ACM-ICPC, Syrian Collegiate Programming Contest A Hello SCPC 2018! 水题 B Binary Hamming 水题 C Portals 思路:并查集维护连通性 代码: //#pragma GCC optimize(3) //#pragma comment(linker, "/STACK:102400000,102400000") //c++ // #pragma GCC diagnostic error &quo…
2018 German Collegiate Programming Contest (GCPC 18) Attack on Alpha-Zet 建树,求lca 代码: #include <algorithm> #include <iterator> #include <iostream> #include <cstring> #include <cstdlib> #include <iomanip> #include <bit…
  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 out…
2018 AICCSA Programming Contest A Tree Game B Rectangles 思路:如果存在大于0的交面积的话, 那么肯定能找到一条水平的直线 和 一条垂直的直线, 使得水平直线的左右两边点的个数相等且为n, 垂直直线的左右两边点的个数相等且为n 也就是说不能有点在这两条线上, 否则交面积为0 然后左上角的点和右下角的点配对, 左下角的点和右上角的点配对 代码: #pragma GCC optimize(2) #pragma GCC optimize(3) #…
A - Airport Coffee 留坑. B - Best Relay Team 枚举首棒 #include <bits/stdc++.h> using namespace std; #define N 510 #define INF 0x3f3f3f3f struct node { string name; double v1, v2; inline void scan() { cin >> name >> v1 >> v2; } inline boo…