原题: BZOJ1032 (原题数据有问题) /*hdu6212[区间dp] 2017青岛ACM-ICPC网络赛*/ #include <bits/stdc++.h> using namespace std; , kase = ; ]; ][], cnt[], col[]; void solve() { memset(dp, 0x3f, sizeof(dp)); tot = ; n = strlen(s); cnt[tot] = , col[tot] = s[] - '; ; i < n…
题目连接 Problem There is a tree with n nodes. For each node, there is an integer value ai, (1≤ai​≤1,000,000,000 for 1≤i≤n). There is q queries which are described as follow: Assume the value on the path from node a to node b is t0​,t1​,⋯tm​. You are sup…
Ryuji is not a good student, and he doesn't want to study. But there are n books he should learn, each book has its knowledge a[i]a[i]. Unfortunately, the longer he learns, the fewer he gets. That means, if he reads books from ll to rr, he will get a…
这次网络赛没有打.生病了去医院了..尴尬.晚上回来才看了题补简单题. K  Supreme Number 题目链接:https://nanti.jisuanke.com/t/31452 题意:输入一个整数n(其实可以当成字符串,因为很长啊.),求满足不超过n的supreme number.这个supreme number的定义是,这个字符串的子串都是质数.比如.137就是,但是19就不是. 题解:找规律.我先开始题没看懂,没懂子串也要为素数.后面才看到.然后在纸上枚举了一下可能出现的情况.发现大…
#include<iostream> #include<cstdio> #include<cmath> #include<cstring> #include<algorithm> #include<set> #include<bitset> #include<map> #include<queue> #include<stack> #include<vector> using…
#include<cmath> #include<set> #include<list> #include<deque> #include<map> #include<queue> #include<cstdio> #include<cstring> #include<algorithm> #include<iostream> #include<string> #includ…
Trace There's a beach in the first quadrant. And from time to time, there are sea waves. A wave ( xxx , yyy ) means the wave is a rectangle whose vertexes are ( 000 , 000 ), ( xxx , 000 ), ( 000 , yyy ), ( xxx , yyy ). Every time the wave will wash o…
总结汇总:模板 int getmax_min(char s[]) {//字符串的最大表示法:返回最小数组下标 , j = , k = ; while(i < len && j < len) { k = ; while(s[i+k] == s[j+k] && k < len) k++; if(k == len) return min(i,j); if (s[i + k] < s[j + k]) > j) i = i + k + ; else i…
题目 http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3856 先预处理求出两个素数的和与积,然后枚举n-prime和n/prime的情况. 表达式可能的情况 a a*b a+b a+b+c a*b*c a*b+c  (注意没有(a+b)*c的情况) 对于a*b和a+b的判重 只需要控制 a<=b的范围即可 对于a*b+c的情况 不存在重复情况 对于a+b+c a*b*c 分三种情况 ①a!=b && b!=c…
2013 changsha zoj 3726 3728 3736 3735 2013 chengdu hud 4786 4788 4790 2013 hangzhou hdu 4770 4771 4772 2013 nanjing hdu 4802 4810 4811 2013 changchun hdu 4813 4815 4821 2014 mudanjiang zoj 3819 3827 3822 3829 2014 anshan hdu 5073 5074 5078 2014 beiji…