Keep On Movin Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 275    Accepted Submission(s): 204 Problem Description Professor Zhang has kinds of characters and the quantity of the i-th characte…
Abandoned country Time Limit: 8000/4000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1756    Accepted Submission(s): 475 Problem Description An abandoned country has n(n≤100000) villages which are numbered from 1…
La Vie en rose Time Limit: 14000/7000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 643    Accepted Submission(s): 328 Problem Description Professor Zhang would like to solve the multiple pattern matching problem,…
Acperience Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 484    Accepted Submission(s): 258   Problem Description Deep neural networks (DNN) have shown significant improvements in several appl…
It's All In The Mind Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 505    Accepted Submission(s): 225 Problem Description Professor Zhang has a number sequence a1,a2,...,an . However, the sequ…
这题官方结题报告一直在强调不难,只要注意剪枝就行. 这题剪枝就是生命....没有最优化剪枝就跪了:如果当前连续切割数加上剩余的所有切割数没有现存的最优解多的话,不需要继续搜索了 #include <cstdio> #include <iostream> #include <cmath> #include <cstring> #include <algorithm> # define MAX 33 using namespace std; stru…
题意摘自:http://blog.csdn.net/kdqzzxxcc/article/details/9474169 ORZZ 题意:给你N个花瓶,编号是0 到 N - 1 ,初始状态花瓶是空的,每个花瓶最多插一朵花. 然后有2个操作. 操作1,a b c ,往在a位置后面(包括a)插b朵花,输出插入的首位置和末位置. 操作2,a b ,输出区间[a , b ]范围内的花的数量,然后全部清空. 很显然这是一道线段树.区间更新,区间求和,这些基本的操作线段树都可以logN的时间范围内完成. 操作…
题目链接 可以暴力找一下规律 比如,假设N=7,两人有5题相同,2题不同,枚举X=0->15时,Y的"Not lying"的取值范围从而找出规律 #include<bits/stdc++.h> using namespace std; typedef long long LL; int T; int N,X,Y; string D,A; int main() { ios::sync_with_stdio(false); cin>>T; while(T--)…
2019牛客多校第二场 A Eddy Walker(概率推公式) 传送门:https://ac.nowcoder.com/acm/contest/882/A 题意: 给你一个长度为n的环,标号从0~n-1,从0号点出发,每次向左走或者向右走的概率是相同的,问你出发后,经过n-1个点后,恰好到达点m的概率是多少,答案是一个前缀积 题解: 讨论两个点的情况: 点0->1的期望是1 讨论三个点的情况 假设我们要到点3,我们必须经过点2,然而我们到了点2可能会再回到点1再到达点3,所以我们讨论必须经过的…
题目:传送门. 如果每个字符出现次数都是偶数, 那么答案显然就是所有数的和. 对于奇数部分, 显然需要把其他字符均匀分配给这写奇数字符. 随便计算下就好了. #include <iostream> #include <algorithm> #include <cstdio> #include <cstring> using namespace std; int main() { int T,n,a; scanf("%d",&T);…