码迷,mamicode.com
首页 >  
搜索关键字:nyoj 108 士兵杀敌一    ( 1834个结果
nyoj 587 blockhouses(DFS)
blockhouses 时间限制:1000 ms  |  内存限制:65535 KB 难度:3 描述 Suppose that we have a square city with straight streets. A map of a city is a square board with n rows and n columns, each representing a...
分类:其他好文   时间:2015-04-21 09:54:39    阅读次数:147
NYOJ VF
VF 时间限制:1000 ms  |  内存限制:65535 KB 难度:2 描述 Vasya is the beginning mathematician. He decided to make an important contribution to the science and to become famous all over the world. But...
分类:其他好文   时间:2015-04-20 17:05:16    阅读次数:128
题解nyoj skiing
题目链接原题地址 经典问题,该问题具有最有子结构性质和无后效性,可以用动态规划,也可以用记忆化搜索,代码如下: #include using namespace std; #include #include #include #include #include int d[][2] = {0,1,1,0,0,-1,-1,0}; int f[110][110]; int map[...
分类:其他好文   时间:2015-04-20 17:00:26    阅读次数:85
nyoj613 免费馅饼 动态规划
//就想象成t行11列的数,从下往上遍历相加,找最大值。#include #include int dp[100005][13]; int Max(int a,int b,int c) { int max=a; if(max<b) max=b; if(max<c) max=c; return max; } int main() { int n,x,t,max; while(sc...
分类:其他好文   时间:2015-04-19 21:26:41    阅读次数:149
nyoj素数环(dfs)
素数环 时间限制:1000 ms  |  内存限制:65535 KB 难度:2 描述 有一个整数n,把从1到n的数字无重复的排列成环,且使每相邻两个数(包括首尾)的和都为素数,称为素数环。 为了简便起见,我们规定每个素数环都从1开始。例如,下图就是6的一个素数环。 输入有多组测试数据,每组输入一个n(0 输出每组第一行输出对应的Case序号...
分类:其他好文   时间:2015-04-19 17:59:06    阅读次数:162
NYOJ-305 表达式求值(模拟)
表达式求值 时间限制:3000 ms  |  内存限制:65535 KB 难度:3   描述 Dr.Kong设计的机器人卡多掌握了加减法运算以后,最近又学会了一些简单的函数求值,比如,它知道函数min(20,23)的值是20 ,add(10,98) 的值是108等等。经过训练,Dr.Kong设计的机器人卡多甚至会计算一种嵌套的更复杂的表达式。 假设表达式可以简单定义为: ...
分类:其他好文   时间:2015-04-19 08:57:54    阅读次数:174
NYOJ 427 & HDU 1005 Number Sequence(找循环节)
【题目链接】click here~~ 【题目大意】已经 f(1) = 1, f(2) = 1, f(n) = (A * f(n - 1) + B * f(n - 2)) mod 7.求f(n), 【解题思路】:此题是大三届的一场比赛题,前几天做了下,结果是不忍直视啊,wa了几乎一页了,最开始想的是用矩阵快速幂,但是想了想,取模数才不到10,7 7=49,也就是说最大结果不超过49种可...
分类:其他好文   时间:2015-04-18 22:02:10    阅读次数:154
nyoj 308 Substring
Substring 时间限制:1000 ms  |  内存限制:65535 KB 难度:1 描述 You are given a string input. You are to find the longest substring of input such that the reversal of the substring is also a substring of ...
分类:其他好文   时间:2015-04-17 18:24:31    阅读次数:128
nyoj 最强DE 战斗力 (数论入门)
最强DE 战斗力 时间限制:1000 ms  |  内存限制:65535 KB 描述 春秋战国时期,赵国地大物博,资源非常丰富,人民安居乐业。但许多国家对它虎视眈眈,准备联合起来对赵国发起一场战争。 显然,面对多个国家的部队去作战,赵国的兵力明显处于劣势。战斗力是决定战争成败的关键因素,一般来说,一支部队的战斗力与部队的兵力成正比。但当把一支部队分成若干个作战队伍时,这个部队的战斗力就...
分类:其他好文   时间:2015-04-17 18:15:07    阅读次数:159
nyoj58 最少步数
最少步数 时间限制:3000 ms  |  内存限制:65535 KB 难度:4 描述 这有一个迷宫,有0~8行和0~8列:  1,1,1,1,1,1,1,1,1  1,0,0,1,0,0,1,0,1  1,0,0,1,1,0,0,0,1  1,0,1,0,1,1,0,1,1  1,0,0,0,0,1,0,0,1  1,1,0,1,0,1,0,0,1  1...
分类:其他好文   时间:2015-04-16 17:38:58    阅读次数:107
1834条   上一页 1 ... 94 95 96 97 98 ... 184 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!