- 博客(45)
- 收藏
- 关注
转载 java 线程池场景
java 一共含有四种线程池: newCachedThreadPool, newFixedThreadPool, newSingleThreadExecutor, newScheduledThreadPool。newCachedThreadPool:顾名思义是一种可缓存的线程池, 线程池除了维护初始大小的线程外,当任务数量超出线程池大小时,便会新建线程, 而且当线程完成任务之后不会马...
2018-01-20 11:56:00 113
转载 angularJs 变量会有类型之分
<select ng-model="inventory.vegetableId+''" ng-options="vegetable.id as vegetable.name for vegetable in vegetables"> <option value="">--- 蔬菜 ---</option></select>当inve...
2017-12-27 16:41:00 124
转载 对OutOfMemoryError的排查
今早配置项目环境,启动tomcat后,访问主页面 后台出现java.lang.OutOfMemoryError: Java heap space 。依照正常的思维,调大jvm堆的大小,修改tomcat/bin/catalina.sh 加上 set java_opts=-Xms512m -Xmx4096m ,随后启动项目时,出现 ubable to ping server local...
2017-12-26 09:57:00 249
转载 POJ 1442 -- Black Box(大小堆,优先队列)
DescriptionOur Black Box represents a primitive database. It can save an integer array and has a special i variable. At the initial moment Black Box is empty and i equals 0. This Black Box ...
2016-11-19 16:58:00 110
转载 Codeforces Beta Round #1 C.Ancient Berland Circus
C. Ancient Berland Circustime limit per test2 secondsmemory limit per test64 megabytesinputstandard inputoutputstandard outputNowadays all circuses in Berland have a round arena with diameter 13 ...
2016-06-10 21:54:00 96
转载 lightoj-1013 - Love Calculator(lcs变体)
1013 - Love Calculator PDF (English) Statistics ForumTime Limit: 2 second(s) Memory Limit: 32 MBYes, you are developing a 'Love calculator'. The software would be quite complex such that nob...
2016-06-09 13:09:00 140
转载 lightoj-1147 - Tug of War(状压dp)
1147 - Tug of War PDF (English) Statistics ForumTime Limit: 4 second(s) Memory Limit: 32 MBA tug of war is to be arranged at the local office picnic. For the tug of war, the picnickers must ...
2016-06-08 23:44:00 104
转载 lightoj-1193 - Dice (II)(dp+前缀和)
1193 - Dice (II) PDF (English) Statistics ForumTime Limit: 3 second(s) Memory Limit: 32 MBYou have N dices; each of them has K faces numbered from 1 to K. Now you can arrange the N dices in ...
2016-06-08 01:46:00 118
转载 lightoj-1110 - An Easy LCS (LCS+路径记录)
1110 - An Easy LCS PDF (English) Statistics ForumTime Limit: 2 second(s) Memory Limit: 32 MBLCS means 'Longest Common Subsequence' that means two non-empty strings are given; you have to fin...
2016-06-08 01:03:00 106
转载 lightoj-1145 - Dice (I)(dp计数)
1145 - Dice (I) PDF (English) Statistics ForumTime Limit: 2 second(s) Memory Limit: 32 MBYou have N dices; each of them has K faces numbered from 1 to K. Now you have arranged the N dices in...
2016-06-07 13:59:00 129
转载 lightoj-1050 - Marbles(dp)
1050 - Marbles PDF (English) Statistics ForumTime Limit: 2 second(s) Memory Limit: 32 MBYour friend Jim has challenged you to a game. He has a bag containing red and blue marbles. There will...
2016-06-07 00:00:00 128
转载 lightoj-1305 - Area of a Parallelogram(几何)
1305 - Area of a Parallelogram PDF (English) Statistics ForumTime Limit: 1 second(s) Memory Limit: 32 MBA parallelogram is a quadrilateral with two pairs of parallel sides. See the picture b...
2016-06-06 17:53:00 165
转载 lightoj-1354 - IP Checking(水题)
1354 - IP Checking PDF (English) Statistics ForumTime Limit: 2 second(s) Memory Limit: 32 MBAn IP address is a 32 bit address formatted in the following waya.b.c.dwhere a, b, c, d are in...
2016-06-06 15:47:00 112
转载 lightoj-1433 - Minimum Arc Distance(几何)
1433 - Minimum Arc Distance PDF (English) Statistics ForumTime Limit: 2 second(s) Memory Limit: 32 MBYou all probably know how to calculate the distance between two points in two dimensional...
2016-06-06 14:49:00 231
转载 lightoj-1227 - Boiled Eggs(贪心)
1227 - Boiled Eggs PDF (English) Statistics ForumTime Limit: 0.5 second(s) Memory Limit: 32 MBThree of the trouble-makers went to Malaysia this year. A rest house was booked for them. Unlike...
2016-06-06 14:33:00 147
转载 lightoj-1189 - Sum of Factorials(贪心)
1189 - Sum of Factorials PDF (English) Statistics ForumTime Limit: 0.5 second(s) Memory Limit: 32 MBGiven an integer n, you have to find whether it can be expressed as summation of factorial...
2016-06-05 19:03:00 145
转载 lightoj-1182 - Parity(位运算)
1182 - Parity PDF (English) Statistics ForumTime Limit: 0.5 second(s) Memory Limit: 32 MBGiven an integer n, first we represent it in binary. Then we count the number of ones. We say n has o...
2016-06-05 17:10:00 111
转载 lightoj-1011 - Marriage Ceremonies(状压dp)
1011 - Marriage Ceremonies PDF (English) Statistics ForumTime Limit: 2 second(s) Memory Limit: 32 MBYou work in a company which organizes marriages. Marriages are not that easy to be made, s...
2016-06-05 12:03:00 108
转载 lightoj-1009 - Back to Underworld(dfs+仿二分图染色)
1009 - Back to Underworld PDF (English) Statistics ForumTime Limit: 4 second(s) Memory Limit: 32 MBThe Vampires and Lykans are fighting each other to death. The war has become so fierce that...
2016-06-04 22:57:00 108
转载 lightoj-1023 - Discovering Permutations(全排列)
1023 - Discovering Permutations PDF (English) Statistics ForumTime Limit: 0.5 second(s) Memory Limit: 32 MBIn this problem you have to find the permutations using the first N English capital...
2016-06-01 23:08:00 135
转载 lightoj-1028 - Trailing Zeroes (I)(素数法求因子个数)
1028 - Trailing Zeroes (I) PDF (English) Statistics ForumTime Limit: 2 second(s) Memory Limit: 32 MBWe know what a base of a number is and what the properties are. For example, we use decima...
2016-06-01 17:57:00 135
转载 lightoj-1089 - Points in Segments (II)(线段树+离散化)
1089 - Points in Segments (II) PDF (English) Statistics ForumTime Limit: 2 second(s) Memory Limit: 64 MBGiven n segments (1 dimensional) and q points, for each point you have to find the num...
2016-06-01 17:22:00 119
转载 lightoj-1088 - Points in Segments(二分法)
1088 - Points in Segments PDF (English) Statistics ForumTime Limit: 2 second(s) Memory Limit: 32 MBGiven n points (1 dimensional) and q segments, you have to find the number of points that l...
2016-06-01 12:30:00 121
转载 lightoj-1027 - A Dangerous Maze(数学期望)
1027 - A Dangerous Maze PDF (English) Statistics ForumTime Limit: 2 second(s) Memory Limit: 32 MBYou are in a maze; seeing n doors in front of you in beginning. You can choose any door you l...
2016-05-31 00:34:00 99
转载 lightoj-1042 - Secret Origins
1042 - Secret Origins PDF (English) Statistics ForumTime Limit: 0.5 second(s) Memory Limit: 32 MBThis is the tale of Zephyr, the greatest time traveler the world will never know. Even those ...
2016-05-30 21:10:00 107
转载 lightoj-1021 - Painful Bases(状压+数位dp)
1021 - Painful Bases PDF (English) Statistics ForumTime Limit: 2 second(s) Memory Limit: 32 MBAs you know that sometimes base conversion is a painful task. But still there are interesting fa...
2016-05-30 19:50:00 111
转载 lightoj-1047 - Neighbor House(简单的线性dp)
1047 - Neighbor House PDF (English) Statistics ForumTime Limit: 0.5 second(s) Memory Limit: 32 MBThe people of Mohammadpur have decided to paint each of their houses red, green, or blue. The...
2016-05-29 23:35:00 107
转载 lightoj-1044 - Palindrome Partitioning(区间dp)
1044 - Palindrome Partitioning PDF (English) Statistics ForumTime Limit: 1 second(s) Memory Limit: 32 MBA palindrome partition is the partitioning of a string such that each separate substri...
2016-05-29 22:47:00 126
转载 lightoj-1045 - Digits of Factorial(利用对数)
1045 - Digits of Factorial PDF (English) Statistics ForumTime Limit: 2 second(s) Memory Limit: 32 MBFactorial of an integer is defined by the following functionf(0) = 1f(n) = f(n - 1) * n, if...
2016-05-29 19:47:00 94
转载 lightoj-1082 - Array Queries
1082 - Array Queries PDF (English) Statistics ForumTime Limit: 3 second(s) Memory Limit: 64 MBGiven an array with N elements, indexed from 1 to N. Now you will be given some queries in the f...
2016-05-29 18:21:00 98
转载 lightoj-1098 - A New Function(因子和)
1098 - A New Function PDF (English) Statistics ForumTime Limit: 3 second(s) Memory Limit: 32 MBWe all know that any integer number n is divisible by 1 and n. That is why these two numbers ar...
2016-05-29 16:40:00 146
转载 lightoj-1072 - Calm Down(找出等价关系)
1072 - Calm Down PDF (English) Statistics ForumTime Limit: 2 second(s) Memory Limit: 32 MBGeorge B. wants to be more than just a good American. He wants to make his daddy proud and become a ...
2016-05-29 13:57:00 189
转载 lightoj-1094 Farthest Nodes in a Tree(求树的直径)
1094 - Farthest Nodes in a Tree PDF (English) Statistics ForumTime Limit: 2 second(s) Memory Limit: 32 MBGiven a tree (a connected graph with no cycles), you have to find the farthest nodes ...
2016-05-29 13:19:00 102
转载 1017 - Brush (III)
1017 - Brush (III) PDF (English)StatisticsForumTime Limit: 2 second(s)Memory Limit: 32 MBSamir returned home from the contest and got angry after seeing his room dusty. Who likes to see...
2016-05-29 00:49:00 105
转载 ligtoj 1007 - Mathematically Hard(欧拉函数+前缀和)
1007 - Mathematically Hard PDF (English) Statistics ForumTime Limit: 2 second(s) Memory Limit: 64 MBMathematically some problems look hard. But with the help of the computer, some problems c...
2016-05-27 17:28:00 90
转载 HDU-3507 Print Article(dp+斜率优化)
解题思路:这道题的意思就是说输出一串数字,可以在不同行, cost 每行数字的平方+m, 求cost的最小值这道题咋看一看dp 解就可以了 dp[i] = dp[j] + (sum[i]-sum[j])^2;很容易就能得出dp方程,但是时间复杂度是O(n^2),所以会爆。所以需要优化它, 这种优化方法叫斜率优化(用斜率的形式得出谁是优解)比如计算i 与 j,k 之间的优...
2016-05-18 17:20:00 203
转载 均分纸牌(贪心求区间和为平均数的最多个数)
Description 有 N 堆纸牌,编号分别为 1,2,…, N。每堆上有若干张,但纸牌总数必为 N 的倍数。可以在任一堆上取若于张纸牌,然后移动。 移牌规则为:在编号为 1 堆上取的纸牌,只能移到编号为 2 的堆上;在编号为 N 的堆上取的纸牌,只能移到编号为 N-1 的堆上;其他堆上取的纸牌,可以移到相邻左边或右边的堆上。 现在要求找出一种移动方法,用最少...
2016-05-17 22:59:00 92
转载 Codeforces Round #353 (Div. 2) C. Money Transfers
解题思路:由均分纸牌的思想可以得知 当区间和为0的区间个数出现最多时,所需要的移动次数是最少的,从1遍历到n 如果相同数字产生次数最多的即为区间和为0个数出现最多的次数(相同数字的产生是因为中间区间和为0),起点的位置不会影响区间和的个数,因为整体区间就那一个。注意题目的数据类型。#include<iostream>#include<algorit...
2016-05-17 22:26:00 71
转载 Codeforces Round #352 (Div. 2) D. Robin Hood (二分法+判断平衡态)
解题思路: 由求最小值和求最大值各自二分。由l*(a[l+1]-a[l]):求取填 1~l 到a[l+1]的高度需要多少的钱,如果大于剩余的k 则可执行 若否 判断剩余的k是否为l,若否最小值为a[l],否则 为a[l]+k/l;由(n-r+1)*(a[r]-a[r-1]):求去掉n~n-r+1的这部分需要多少钱,如果大于剩余的k 则执行 若否 判断剩余的k是否为n-r+1,若是...
2016-05-14 00:28:00 95
转载 Codeforces Round #352 (Div. 2) C. Recycling Bottles(枚举)
思路:分析完这道题后会发现 当两个人捡到第一个瓶子后, 之后走的路的最小值都是不会变的了。 所以只要找出两个走到各自的第一个瓶子是最小值的情况的时候(其中还有一个人不走,一个人走的情况)。 如果当有两个人或有一个人到其第一个瓶子的权值大于瓶子到回收点时,选取权值小的那个。而且计算最小值的时候 只需取出两个权值数组中最小的两个数 即可 不用全部遍历来选取。#...
2016-05-14 00:18:00 83
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人