- 博客(13)
- 收藏
- 关注
原创 SDUT3899_sum of power(大数问题)
sum of power Time Limit: 1000 ms Memory Limit: 65536 KiB Submit Statistic Discu...
2018-04-18 20:49:28 224
原创 Java字符串整理
一、字符串的输入与转换:in.next(); //到空格就结束in.nextLine();String str = new String();1.一维:(1)空格不当做字符串的: String g[] = new String[n]; //字符串数组 for(int i=0;i<n;i++) g[i] = in.next(); //字符串类型的,到空格结束(每一个可以不...
2018-04-16 15:27:56 307
原创 Java大数有关的知识
大数:BigInteger 和 BigDecimal分别表示大整数类和大浮点数类。这两个类都在java.math.*包中,因此每次必须在开头处引用该包一、大数的基本运算:以整数为例实现 BigInteger 1.)输入: BigInteger a = in.nextBigInteger(); 或者:BigInteger b = new BigInteger(in.next()); 2.)...
2018-04-16 15:22:14 260
原创 poj_3045_Cow Acrobats(二分搜索)
Cow AcrobatsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 6266 Accepted: 2349DescriptionFarmer John's N (1 <= N <= 50,000) cows (numbered 1..N) are planning to run away and join the ...
2018-04-09 20:56:30 211
原创 poj_3273_Monthly Expense(二分搜索,最小花费)
Monthly ExpenseTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 32155 Accepted: 12113DescriptionFarmer John is an astounding accounting wizard and has realized he might run out of money to ru...
2018-04-09 20:52:57 172
原创 poj_3258_River Hopscotch(二分搜索,最下最大问题)
River HopscotchTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 17792 Accepted: 7437DescriptionEvery year the cows hold an event featuring a peculiar version of hopscotch that involves carefu...
2018-04-09 20:39:33 244 1
原创 poj_1064_Cable master(二分搜索,最大最小/最小最大)
Cable masterTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 58900 Accepted: 12275DescriptionInhabitants of the Wonderland have decided to hold a regional programming contest. The Judging Com...
2018-04-09 20:35:01 128
原创 poj_2456_Aggressive cows(二分搜索----最大最小/最小最大问题)
Aggressive cowsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 18363 Accepted: 8740DescriptionFarmer John has built a new long barn, with N (2 <= N <= 100,000) stalls. The stalls are l...
2018-04-09 20:27:35 223
原创 贪心_过河问题
题目意思:每个人过河都有自己的过河时间,有n个人想过河,但只有一只小船,最多只能装2个人,每一次过河,过河时间为用时最多的那人过河时间,如果还有人没有过河,那么过去一个用时最少的送回船。问n人过河最少要多少时间。分析:参考网上的思路题意:也就是一个坐船问题,一共有两个策略①最快和次快过去,最快回;最慢和次慢过去,次快回,t=s[1]+s[0]+s[n-1]+s[1]。②最快和最慢过去,最快回;最快...
2018-04-09 19:25:53 533
原创 poj_3984_迷宫问题(深搜)
迷宫问题Time Limit: 1000MS Memory Limit: 65536KTotal Submissions: 29580 Accepted: 17017Description定义一个二维数组: int maze[5][5] = { 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0...
2018-04-09 19:17:47 555
原创 广搜最小转机(啊哈)
在一个无向图中import java.util.*; class node { //在哪个城市转机几次 int x; //城市编号 int k; //转机次数 } public class Main{ static int maxx = 1005; static int n,m,s,t; //n个城市,m条航线,s起点,t终点 static int head,tail; st...
2018-04-09 19:10:08 362 1
原创 poj_1321_棋盘问题(深搜,不同行不同列)
棋盘问题Time Limit: 1000MS Memory Limit: 10000KTotal Submissions: 59097 Accepted: 28382Description在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放方案C。Input输...
2018-04-09 19:05:40 766
原创 poj_3278_Catch That Cow(搜索广搜)
Catch That CowTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 109183 Accepted: 34100DescriptionFarmer John has been informed of the location of a fugitive cow and wants to catch her immediat...
2018-04-09 18:48:43 163
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人