随笔分类 - 一天到晚刷水题
摘要:##题解 给你一个n让你求有多少个数列相加可以得到这个n,要求所有数为正整数,那么根据隔板法列出排列组合公式,随后进行二项式转化,那么我们求的就是2的n-1次方,但是由于n过于大,我们需要使用欧拉降幂,因为2和mod互质,由欧拉降幂公式转换后,我们只需要对这个大数n模上一个mod-1,随后对其做快速
阅读全文
摘要:##题目 Problem Description As we know,the shape of a binary search tree is greatly related to the order of keys we insert. To be precisely: insert a key
阅读全文
摘要:##题目 Problem Description Sean owns a company and he is the BOSS.The other Staff has one Superior.every staff has a loyalty and ability.Some times Sean
阅读全文
摘要:##题目 给出一个只由小写英文字符a,b,c...y,z组成的字符串S,求S中最长回文串的长度. 回文就是正反读都是一样的字符串,如aba, abba等 ##思路 马拉车。马拉车的核心思想就是通过前面已经匹配了的回文串和其对称性来快速计算右半边的p数组值,这样就省去了多次中心扩展的次数,从而降低了时
阅读全文
摘要:##题目 A group of K friends is going to see a movie. However, they are too late to get good tickets, so they are looking for a good way to sit all nearb
阅读全文
摘要:##题目 In Frobnia, a far-away country, the verdicts in court trials are determined by a jury consisting of members of the general public. Every time a t
阅读全文
摘要:##题目 在完成了分配任务之后,西部314来到了楼兰古城的西部。 相传很久以前这片土地上(比楼兰古城还早)生活着两个部落,一个部落崇拜尖刀(‘V’),一个部落崇拜铁锹(‘∧’),他们分别用V和∧的形状来代表各自部落的图腾。 西部314在楼兰古城的下面发现了一幅巨大的壁画,壁画上被标记出了N个点,经测
阅读全文
摘要:##题面 You are given a sequence of n integers a1 , a2 , ... , an in non-decreasing order. In addition to that, you are given several queries consisting
阅读全文
摘要:##Problem A 就输出n个1个好了 ##Probem B 就看有没有相同的,因为从二进制的角度看的话,你要其他的加起来和这个相等,必须要有两个相等。 ##Problem C 乱搞样例你就会发现,和奇偶性有关,你维护奇偶性就好了。 ##Problem D 题意是给你一个序列,然后问你能不能通过
阅读全文
摘要:##题目 It is very hard to wash and especially to dry clothes in winter. But Jane is a very smart girl. She is not afraid of this boring process. Jane ha
阅读全文
摘要:##题目 Given a N × N matrix A, whose element in the i-th row and j-th column Aij is an number that equals i2 + 100000 × i + j2 - 100000 × j + i × j, you
阅读全文
摘要:##题目 Problem Description Ignatius has just come back school from the 30th ACM/ICPC. Now he has a lot of homework to do. Every teacher gives him a dead
阅读全文
摘要:##题目 A group of researchers are designing an experiment to test the IQ of a monkey. They will hang a banana at the roof of a building, and at the mean
阅读全文
摘要:##题目 Problem Description Now I think you have got an AC in Ignatius.L's "Max Sum" problem. To be a brave ACMer, we always challenge ourselves to more
阅读全文
摘要:###链接:https://codeforces.com/contest/467/problem/C 这道题是求拿k个子序列且不能相交,问如何拿使得这些序列的值的和最大,那么阶段划分就很明显了,相当于这道问题对应的隐式DAG上一共可以被分成K层,接着就是枚举在哪个点转移,也就是是否取当前的往左m的区
阅读全文
摘要:##Problem A 我们构造以l为a,那么转换一下题目的方程,就可以发现,$2*l>r$的时候条件一定成立。 ##Problem B 不知道什么鬼,猜一发就能过了。大概就是连续的0和1的数量取一个max。 ##Problem C 本来是想贪心的,但是这个题目太难搞了。最后思路还是走向dp,首先我
阅读全文
摘要:##题目 Problem Description 搬寝室是很累的,xhd深有体会.时间追述2006年7月9号,那天xhd迫于无奈要从27号楼搬到3号楼,因为10号要封楼了.看着寝室里的n件物品,xhd开始发呆,因为n是一个小于2000的整数,实在是太多了,于是xhd决定随便搬2k件过去就行了.但还是
阅读全文
摘要:##题目 Problem Description 为了训练小希的方向感,Gardon建立了一座大城堡,里面有N个房间(N<=10000)和M条通道(M<=100000),每个通道都是单向的,就是说若称某通道连通了A房间和B房间,只说明可以通过这个通道由A房间到达B房间,但并不说明通过它可以由B房间到
阅读全文
摘要:##题目 This year is the 60th anniversary of NJUST, and to make the celebration more colorful, Tom200 is going to invite distinguished alumnus back to vi
阅读全文
摘要:##Problem A 因为给的数组长度为偶数,所以每一项都和后一项抵消就好了。 ##Problem B 因为每个元素都是不一样的,所以我们只需要把行根据第一列的元素进行reorder就好了。 #include<bits/stdc++.h> using namespace std; const in
阅读全文

浙公网安备 33010602011771号