- 博客(81)
- 资源 (3)
- 收藏
- 关注
原创 UVA - 103 - Stacking Boxes (动态规划)
UVA - 103Stacking BoxesTime Limit: 3000MS Memory Limit: Unknown 64bit IO Format: %lld & %lluSubmit StatusDescriptionBackgroundSome concepts in Mathe
2015-03-31 23:24:27 673
原创 UVA - 10954 - Add All (贪心)
UVA - 10954Add AllTime Limit: 3000MSMemory Limit: Unknown64bit IO Format: %lld & %lluSubmit StatusDescriptionProblem FAdd AllInput: standard inputOutput: stan
2015-03-31 22:12:35 1131
原创 UVA - 10700 - Camel trading (简单贪心)
UVA - 10700Camel tradingTime Limit: 3000MS Memory Limit: Unknown 64bit IO Format: %lld & %lluSubmit StatusDescriptionProblem E - Camel tradingTime L
2015-03-30 23:37:46 685
原创 SGU - 133 - Border (简单统计)
133. Bordertime limit per test: 0.25 sec. memory limit per test: 4096 KBAlong the border between states A and B there are N defence outposts. For every outpost k, the interval [Ak,Bk] whic
2015-03-29 21:08:46 575
原创 URAL - 1009 - K-based Numbers (简单DP)
1009. K-based NumbersTime limit: 1.0 secondMemory limit: 64 MBLet’s consider K-based numbers, containing exactly N digits. We define a number to be valid if itsK-based notation doesn’t c
2015-03-29 21:03:35 588
原创 Codeforces Round #285 (Div. 2) -- A,B
A. Contesttime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputMisha and Vasya participated in a Codeforces cont
2015-03-28 14:56:12 777
原创 java大数类操作以及应用(UVA)
首先,先看看java大数的基本操作Ⅰ基本函数:1.valueOf(parament); 将参数转换为制定的类型 比如 int a=3; BigInteger b=BigInteger.valueOf(a); 则b=3; String s=”12345”; BigInteger c=BigInteger.valueOf(s); 则c=12345;
2015-03-28 13:14:42 1138
原创 UVA - 439 - Knight Moves (BFS)
UVA - 439Knight MovesTime Limit: 3000MS Memory Limit: Unknown 64bit IO Format: %lld & %lluSubmit StatusDescriptionA friend of you is doing research on t
2015-03-27 23:41:08 901
原创 Codeforces Round #297 (Div. 2) -- D. Arthur and Walls (判断矩形)
D. Arthur and Wallstime limit per test2 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputFinally it is a day when Arthur has eno
2015-03-27 12:04:30 982 4
原创 Codeforces Round #297 (Div. 2) -- (A,B,C)
A. Vitaliy and Pietime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAfter a hard day Vitaly got very hungry
2015-03-27 11:54:28 977
原创 POJ - 3070 - Fibonacci (矩阵快速幂 + 斐波那契数列)
FibonacciTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 10096 Accepted: 7208DescriptionIn the Fibonacci integer sequence, F0 = 0, F1 = 1, and Fn = Fn
2015-03-26 23:17:25 3954
原创 ACdream OJ - 1061 && 1062 && 1098 && 1099
郭式树Time Limit: 4000/2000MS (Java/Others)Memory Limit: 256000/128000KB (Java/Others)SubmitStatisticNext ProblemProblem Description郭橐驼,不知始何名。病偻,隆然伏行,有类橐驼者,故乡人号之驼。驼闻之,曰:“甚善。名我固当。”因舍其名,亦
2015-03-26 22:10:15 899
原创 ZOJ - 3623 - Battle Ships (01背包变形)
Battle ShipsTime Limit: 2 Seconds Memory Limit: 65536 KBBattle Ships is a new game which is similar to Star Craft. In this game, the enemy builds a defense tower, which has L longevity.
2015-03-25 21:00:46 686
原创 UVA - 562 - Dividing coins (01背包)
UVA - 562Dividing coinsTime Limit: 3000MS Memory Limit: Unknown 64bit IO Format: %lld & %lluSubmit StatusDescriptionIt's commonly known that the Dutch h
2015-03-25 18:43:09 779
原创 HDU - 1114 - Piggy-Bank (完全背包)
Piggy-BankTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 13822 Accepted Submission(s): 7000Problem DescriptionBefore ACM can
2015-03-25 17:05:30 738
原创 UVA - 674 - Coin Change (背包型DP)
UVA - 674Coin ChangeTime Limit: 3000MS Memory Limit: Unknown 64bit IO Format: %lld & %lluSubmit StatusDescriptionSuppose there are 5 types of coins: 50-
2015-03-25 16:25:28 867
转载 简明 Vim 练级攻略
vim的学习曲线相当的大(参看各种文本编辑器的学习曲线),所以,如果你一开始看到的是一大堆VIM的命令分类,你一定会对这个编辑器失去兴趣的。下面的文章翻译自《Learn Vim Progressively》,我觉得这是给新手最好的VIM的升级教程了,没有列举所有的命令,只是列举了那些最有用的命令。非常不错。——————————正文开始——————————你想以最快的速度学习人类
2015-03-25 10:33:00 765
原创 UVA - 10003 - Cutting Sticks (区间DP)
这里简述一下区间DP:主要思想:区间动态规划问题一般都是考虑对于每段区间,他们的最优值都是由几段更小区间的最优值得到,是分治思想的一种应用,将一个区间问题不断划分为更小的区间直至一个素组成的区间,枚举他们的组合,求合并后的最优值。定义状态:设dp[i][j]为区间i,j之间的最小代价(实际看题意)实现过程:for(int p = 1 ; p //p是区间的长度,作为阶段
2015-03-24 23:18:14 757
原创 UVA - 10012 - How Big Is It? (枚举)
思路:刚开始以为直接全排列枚举一下就好了,结果WA了。没想到没这么简单,重新排列后还要判断当前情况是否能够成立(这时可能会有相交的)。比如现在有两个大圆中间围着几个很小很小的圆,肯定是两个大圆先相切,中间几个小圆就有空隙了,这就能说通相邻的圆可以不相切而又使得box最小,解决方案是算出当前圆和之前的圆的相对位置取最大值,这样就能够保证既能够最大,又能够不相交AC代码:#includ
2015-03-24 19:48:50 823
原创 ZZULI - 1705 && 1706 && 1707 && 1708 && 1709 && 1710 && 1711 && 1712
1705: 小明在工作Time Limit: 1 Sec Memory Limit: 128 MBSubmit: 83 Solved: 25SubmitStatusWeb BoardDescription小明的工作是负责记录饭堂中正在排队的人的信息 在他的工作中会有三种可能的事件发生: 1.编号为id的学生加入到队伍的最后面 2.排在
2015-03-23 18:56:32 1349
原创 UVA - 301 - Transportation (暴力回溯)
UVA - 301TransportationTime Limit: 3000MS Memory Limit: Unknown 64bit IO Format: %lld & %lluSubmit StatusDescriptionRuratania is just entering capitalis
2015-03-23 14:40:19 748
原创 UVA - 639 - Don't Get Rooked (暴力回溯)
UVA - 639Don't Get RookedTime Limit: 3000MS Memory Limit: Unknown 64bit IO Format: %lld & %lluSubmit StatusDescriptionIn chess, the rook is a piece that
2015-03-23 13:25:27 1014
原创 UVA - 10591 - Happy Number (STL)
UVA - 10591Happy NumberTime Limit: 3000MSMemory Limit: Unknown64bit IO Format: %lld & %lluSubmit StatusDescription Problem CHappy Number
2015-03-22 20:22:48 862
原创 UVA - 10125 - Sumsets (暴力枚举 + STL)
思路:刚开始的思路是直接暴力枚举O(n3),感觉会超时,不过还是试着敲了下,居然过了,其中用STL中的set来找最后一个数,最好先排下序,然后再枚举d(要求的)和a,b,再用set去找cAC代码:#include #include #include #include #include using namespace std;int a[1005];int flag,
2015-03-22 20:03:58 549
原创 常用
一、求程序运行时间#include #include using namespace std;int main() { printf("%.2lf\n", (double)clock() / CLOCKS_PER_SEC );//单位s printf("%d\n", clock());//单位ms } 二、文件操作1、输入输出重定
2015-03-22 14:57:16 619
原创 UVA - 10420 - List of Conquests (排序 - qsort、STL)
UVA - 10420List of ConquestsTime Limit: 3000MSMemory Limit: Unknown64bit IO Format: %lld & %lluSubmit StatusDescriptionProblem BList of ConquestsInput: standa
2015-03-22 13:44:58 850
原创 UVA - 624 - CD (动态规划)
UVA - 624CDTime Limit: 3000MS Memory Limit: Unknown 64bit IO Format: %lld & %lluSubmit StatusDescriptionYou have a long drive by car ahead. You have a t
2015-03-22 11:26:59 1277
原创 UVA - 10130 - SuperSale (动态规划 - 01背包)
10130 SuperSaleThere is a SuperSale in a SuperHiperMarket. Every person can take only one object of each kind, i.e.one TV, one carrot, but for extra low price. We are going with a whole family to
2015-03-22 10:24:56 1175
原创 HDU - 5190 - Go to movies && 5191 - Building Blocks (BC#34 A,B)
Go to moviesTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 99 Accepted Submission(s): 67Problem DescriptionWinter holiday is
2015-03-21 23:10:35 956
原创 蓝桥杯 - 幸运数 (打表)
历届试题 幸运数 时间限制:1.0s 内存限制:256.0MB 问题描述幸运数是波兰数学家乌拉姆命名的。它采用与生成素数类似的“筛法”生成。首先从1开始写出自然数1,2,3,4,5,6,....1 就是第一个幸运数。我们从2这个数开始。把所有序号能被2整除的项删除,变为:1 _ 3 _ 5 _ 7 _
2015-03-21 17:33:05 2596
原创 蓝桥杯 - 买不到的数目 (动态规划 + 数论)
历届试题 买不到的数目 时间限制:1.0s 内存限制:256.0MB 问题描述小明开了一家糖果店。他别出心裁:把水果糖包成4颗一包和7颗一包的两种。糖果不能拆包卖。小朋友来买糖的时候,他就用这两种包装来组合。当然有些糖果数目是无法组合出来的,比如要买 10 颗糖。你可以用计算机测试一下,在这种包装情况下,最大不能买到的数量
2015-03-21 15:14:33 2810 2
原创 UVA - 10714 - Ants
UVA - 10714AntsTime Limit: 3000MS Memory Limit: Unknown 64bit IO Format: %lld & %lluSubmit StatusDescriptionProblem B: AntsAn army of ants walk on a
2015-03-20 23:25:07 683
原创 UVA - 10474 - Where is the Marble? (基数排序)
UVA - 10474Where is the Marble?Time Limit: 3000MS Memory Limit: Unknown 64bit IO Format: %lld & %lluSubmit StatusDescriptionRaju and Meena love to play
2015-03-20 21:48:35 2258
原创 SGU - 169 - Numbers (找规律)
169. Numberstime limit per test: 0.25 sec.memory limit per test: 4096 KBinput: standardoutput: standardLet us call P(n) - the product of all digits of number n (in decimal nota
2015-03-20 19:11:03 622
原创 UVA - 729 - The Hamming Distance Problem (枚举排列)
思路:数组中有H个1, N-H个0,按照字典序全排列,注意这里数组可以开int型的也可以开char型的,char型的在这里感觉用起来更方便,至少不要for循环,用char型的数组记得要初始化(memset),或者s[N] = '\0',因为这里有多组数据。AC代码①:#include #include #include #include using namespace st
2015-03-20 10:11:33 1282
原创 UVA - 10098 - Generating Fast (枚举排列)
思路:生成全排列,用next_permutation,注意生成之前先对那个字符数组排序。AC代码:#include #include #include #include #include using namespace std;char str[20];int main() { int n; cin >> n; while(n--) { scanf("%
2015-03-19 23:49:27 799
原创 UVA - 146 - ID Codes (枚举排列)
UVA - 146ID CodesTime Limit: 3000MS Memory Limit: Unknown 64bit IO Format: %lld & %lluSubmit StatusDescriptionIt is 2084 and the year of Big Brother has
2015-03-19 22:51:55 701
原创 UVA - 10167 - Birthday Cake (简单枚举)
思路:简单枚举AC代码:#include #include #include #include #include using namespace std;int x[105], y[105];int main() { int A, B, N; while(scanf("%d", &N), N) { for(int i = 0; i < 2 * N; i++
2015-03-19 21:02:24 757
原创 SGU - 196 - Matrix Multiplication (矩阵乘法)
196. Matrix Multiplicationtime limit per test: 0.25 sec.memory limit per test: 65536 KBinput: standardoutput: standardLet us consider an undirected graph G = which has N verti
2015-03-19 19:52:51 805
原创 POJ Challenge Round 5 -- A:magic (物理)
A:magic总时间限制: 1000ms 内存限制: 131072kB描述魔法师Silly Hook正在表演一个神奇的魔术,他变出了他自己的N个分身,并成正N边形分布,他本身处于这个正N边形的中心,正N边形的边长为A。然后,每个分身都会朝顺时针方向下一个分身以一个相同的固定的速度V移动,移动方向会随着下一个分身的位置变化而变化,最终所有分身都将到达正
2015-03-19 18:42:42 931
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人