”zoj“ 的搜索结果

     原题来自:ZOJ 1937 已知一个数列a0,a1...ama_0,a_1...a_ma0​,a1​...am​(其中a0=1,am=n,a0<a1<a2<...<am−1<ama_0 = 1 , a_m = n , a_0 \lt a_1 \lt a_2 \lt ... \lt a_{m-1} \lt a_ma0​=1,a.....

     题解: 虽然题目叫大串串,但很显然,这个题不能直接暴力递推写,会报MLE(内存超出限制)。。。 所以逆推: 用数组记录big string的长度,找到最小的大于等于n的len[i],那么可以想象,n必定&...

     。 转载于:https://www.cnblogs.com/canond/p/4442696.html

     题目大意,湖中有n个石头,一...同zoj1952类似,动态规划,用dist[ i ][ j ]表示从 i 到 j 路径中的最长边,则枚举中间节点 k ,则状态转移方程为dist[ i ][ j ] = min( dist[ i ][ j ] , max(dist[i ][k ],dist[k...

     https://vjudge.net/problem/ZOJ-1655 题目大意: 有N-1个城市给首都(第N个城市)支援物资,有M条路,走每条路要耗费一定百分比的物资。问给定N-1个城市将要提供的物资,和每条路的消耗百分比。求能送到首都的最多...

     题目考虑到回溯,深度搜索 题目解读 Your task is to write a program that, given a description of a map, calculates the maximum number of blockhouses that can be placed in the city in a legal ...

     题目链接:ZOJ1760 Doubleshttps://zoj.pintia.cn/problem-sets/91827364500/problems/91827365259 测试样例 输入样例 1 4 3 2 9 7 18 22 0 2 4 8 10 0 7 5 11 13 1 3 0 -1 输出样例 3 2 0 提交结果截图 ...

ZOJ-1

标签:   c++

     ZOJ-1001 今天开始接触ZOJ,发现不仅是题目的难度对我有挑战,英语水平是我的一大硬伤。还好有谷歌翻译~哈哈哈 Calculate a + b Input 1 5 Output 6 Hint(提示) Use + operator my simple program here: #include ...

     这里写自定义目录标题欢迎使用Markdown编辑器新的改变功能快捷键合理的创建标题,有助于目录的生成如何改变文本的样式插入链接与图片如何插入一段漂亮的代码片生成一个适合你的列表创建一个表格设定内容居中、居左、...

     日常无聊打发时间,刷刷题,由于不记得以前的号了,正好重新码起,...ZOJ1001 A + B Problem Time Limit: 2000 msMemory Limit: 65536 KB Calculate a + b Input The input will consist of a series of pa...

ZOJ.1001

标签:   java

     题目描述 Calculate a + b Input The input will consist of a series of pairs of integers a and b,separated by a space, one pair of integers per line. Output For each pair of input integers a and b you ...

     保证b%k=0。输出每棵树的节点序号。否则输出NO。POINT:输出序号可以借助stack。对于每个根节点,看每条子树还有多少节点。因为每个子树要形成一个树(假设他们合起来为个数为k),必须要用到根节点。...

     //求n到其他点的损率的乘积最大 #include #include #include #include using namespace std; const int mn=105,mm=40005; struct Edge{ int to,next; double w; }edges[mm];...double dis[mn],w[m

     简单题 #include <stdio.h> #include <string.h> int main() { int T,N,n,b[10]; char a[2][50],c[50]; scanf("%d",&T); while (T--) { memset(a,0,sizeof(a));... if

ZOJ 2723

标签:   zoj  素数

     G - Semi-Prime Time Limit:2000MS Memory Limit:65536KB 64bit IO Format:%lld & %llu SubmitStatusPracticeZOJ 2723 Description Prime Number Definition ...An integer greater than one is

ZOJ3321,ZOJ3317

标签:   zoj  ACM

     ZOJ3321 //there is at most one edge between two nodes. 因为这句话的局限性,又要满足环,那么一定是每个点度为2,然后为n节点的一个环 //#include #include #include #include using namespace std; typedef...

     题意: 找出有几个数量相等的连续的区间对。 区间里的相对距离 POINT: n^2的效率遍历上下数组的开头。然后每次扫一遍就有答案。因为区间要连续的。每次都是右边加进来。左边删掉最优。...typedef long lo

     不难。 #include using namespace std; int main() { int num,time = 0; while(cin >> num && num) { time++; int blocks[50],sum = 0,block = 0; for(int m = 0;m ;m

ZOJ

     读入一个字符串,字符串中包含ZOJ三个字符,个数不一定相等,按ZOJ的顺序输出,当某个字符用完时,剩下的仍然按照ZOJ的顺序输出。 输入: 题目包含多组用例,每组用例占一行,包含ZOJ三个字符,当输入“E”时表示...

     Calculate a + b Input The input will consist of a series of pairs of integers a and b,separated by a space, one pair of integers per line. Output For each pair of input integers a and b you should ...

10  
9  
8  
7  
6  
5  
4  
3  
2  
1