
ZOJ
文章平均质量分 75
菜鸟帆
互相交流学习,有什么不对的地方,多多指教
展开
-
ZOJ--1003:Crashing_Balloon(因子分解)
On every June 1st, the Children's Day, there will be a game named "crashing balloon" on TV. The rule is very simple. On the ground there are 100 labeled balloons, with the numbers 1 to 100. After原创 2017-06-05 21:06:07 · 551 阅读 · 0 评论 -
ZOJ--1008:Gnome Tetravex(剪枝dfs)
刚开始 做了一下 超时 然后看网上说要用 剪枝 有趣查了剪枝算法 结果 测试用例(自己写了好多测试用例)都可以通过 但是就是一直WA 想哭import java.util.Scanner;public class Gnome_Tetravex { static int n,arr[][],put[],cnt[],cn,game; static boolean can;原创 2017-06-09 23:25:58 · 455 阅读 · 0 评论 -
ZOJ--1048:Financial Management
睡前 水一道 毫无难度的题 大概意思:输入十二个数 输出平均数import java.util.Scanner;public class Financial_Management { public static void main(String[] args) { Scanner s=new Scanner(System.in); double sum=0; for(in原创 2017-06-12 12:38:41 · 427 阅读 · 0 评论 -
ZOJ--1045:HangOver
睡前 水一下没什么难度import java.util.Scanner;public class HangOver { public static void main(String[] args) { double a,sum; Scanner s=new Scanner(System.in); while((a=s.nextDouble())!=0){ sum=0原创 2017-06-13 23:50:39 · 353 阅读 · 0 评论 -
ZOJ--1009:Enigma
我的思路: 真的是这个题的用例给的真他妈坑 让我直接会错意了 看懂这个题 感觉过了一个世纪 这里用我的用例吧 输入:6 BADFEC 样例中位移量为(1 -1 3 -1 0 -2)转动一次后为(-2 1 -1 3 -1原创 2017-06-13 18:46:51 · 603 阅读 · 1 评论 -
ZOJ--1049:I Think I Need a Houseboat
水题....java:import java.util.Scanner;public class I_Think_I_Need_a_Houseboat_1049 { public static void main(String[] args) { double x,y; double pi=3.1415926; int n; Scanner sc=new Scanne原创 2017-06-13 23:55:18 · 363 阅读 · 0 评论 -
ZOJ--1037:Gridland
思路:若是都是奇数 则肯定有一个斜着走的;否则答案直接为m*n;java:import java.util.Scanner;public class Knight_Moves_1091 { static String str1,str2; static int min,x,y,a,b; static int arr[]={2,2,-2,-2,1,1,-1,-1}; st原创 2017-06-14 21:45:09 · 376 阅读 · 0 评论 -
ZOJ--1067:Color Me Less
思路:这题是让 先输入十六组数 然后给后面的每组数 从这十六组数中找通过那个式子值最小的 一组数据 ;比较简单 不解释java:import java.util.Scanner;public class Color_Me_Less_1067 { public static void main(String[] args) { Scanner s=new Scanner(S原创 2017-06-14 22:11:49 · 386 阅读 · 0 评论 -
ZOJ--1078:Palindrom Numbers
思路:这个题呢 首先知道怎么转换进制 , 就是一直取余。 然后判断这个数是否为回文数即可比较简单不做过多解释java:import java.util.Scanner;public class Palindrom_Numbers_1078 { static int arr[]=new int[1000]; static int b[]=new int[15]; publi原创 2017-06-14 22:40:46 · 546 阅读 · 0 评论 -
ZOJ--1091:Knight Moves(dfs)
思路:这个题说骑士移动,其实就是象棋里的马走日字。(真的,这题里都没解释一下 让咱去梦呢?我是醉了)剩下的就简单了 我是用dfs做java:import java.util.Scanner;public class Knight_Moves_1091 { static String str1,str2; static int min,x,y,a,b; static int原创 2017-06-14 22:49:09 · 648 阅读 · 0 评论 -
ZOJ--1007:Numerical Summation of a Series
Numerical Summation of a SeriesTime Limit: 10 Seconds Memory Limit: 32768 KB Special Judge Produce a table of the values of the series Equation 1 for the 2001 values of x,原创 2017-06-09 23:13:33 · 961 阅读 · 0 评论 -
ZOJ--1006:Do the Untwist
Do the UntwistTime Limit: 2 Seconds Memory Limit: 65536 KB Cryptography deals with methods of secret communication that transform a message (theplaintext) into a disguised form (the c原创 2017-06-09 23:05:04 · 358 阅读 · 0 评论 -
ZOJ--1648:Circuit Board(跨立实验线段判交)
Circuit BoardTime Limit: 2 Seconds Memory Limit: 65536 KB On the circuit board, there are lots of circuit paths. We know the basic constrain is that no two path cross each other, for ot原创 2017-06-19 13:07:39 · 591 阅读 · 0 评论 -
ZOJ--1004:Anagrams by Stack(dfs)
How can anagrams result from sequences of stack operations? There are two sequences of stack operators which can convert TROT to TORT:[i i i i o o o oi o i i o o i o]where i stands for Pus原创 2017-06-06 22:56:58 · 545 阅读 · 0 评论 -
ZOJ--1101:Gamblers(二分查找)
题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=1101题目大意: 游戏开始时,他们各自将自己的赌注盖住,同时任何两个赌徒的赌注是不同的,如果其中一个赌徒没有钱了,他可以借一些筹码,但是他的赌注就是负数了。假设,他们的赌注都是整数。 然后他们揭开所有的赌注原创 2017-06-02 23:48:11 · 703 阅读 · 0 评论 -
ZOJ--1095:Humble Numbers
Humble NumbersTime Limit: 2 Seconds Memory Limit: 65536 KB A number whose only prime factors are 2,3,5 or 7 is called a humble number. The sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14原创 2017-06-19 13:16:18 · 352 阅读 · 0 评论 -
ZOJ--1005:Jugs(dfs)
题目大意:两个壶A和B ,可互相倒水,可加满,可倒空, 输入:Ca Cb N Ca、Cb分别为A B两壶的容量 N为最后B壶所剩水量 输出:操作步骤 pour B A表示从B向A倒水(要么倒满A 要么倒完B) 同理pourA B 最后输出succ...原创 2017-06-07 21:08:40 · 588 阅读 · 0 评论 -
ZOJ--1002:Fire_Net
题目链接:点击打开链接题目大意:在一个n*n的城市里 有墙 在没有墙的地方可以放堡垒,堡垒可以打到东南西北四个方向的任何东西(包括堡垒)但不可以打穿墙,现在在城市里放堡垒 可以使其打到 任何一条街道的任何地方。 求可以放置堡垒的最大数。 输入:先输入n表示城市的边长(最长为4),若n为0结束。 输出:输出每一个城市样例的最大堡垒数例:Sample原创 2017-06-03 23:59:31 · 449 阅读 · 0 评论 -
ZOJ--1016:Parencodings
ParencodingsTime Limit: 2 Seconds Memory Limit: 65536 KB Let S = s1 s2 ... s2n be a well-formed string of parentheses. S can be encoded in two different ways:By an integer sequenc原创 2017-06-20 20:33:23 · 396 阅读 · 0 评论 -
ZOJ--1074:To the Max
To the MaxTime Limit: 2 Seconds Memory Limit: 65536 KB ProblemGiven a two-dimensional array of positive and negative integers, a sub-rectangle is any contiguous sub-array of size 1原创 2017-06-21 00:00:20 · 246 阅读 · 0 评论 -
ZOJ--1088:System Overload(约瑟夫环问题)
System OverloadTime Limit: 10 Seconds Memory Limit: 32768 KB Recently you must have experienced that when too many people use the BBS simultaneously, the net becomes very, very slow.T原创 2017-06-21 21:11:47 · 565 阅读 · 0 评论 -
ZOJ--1010:Area(线段判交问题)
AreaTime Limit: 2 Seconds Memory Limit: 65536 KB Special Judge Jerry, a middle school student, addicts himself to mathematical research. Maybe the problems he has thought are rea原创 2017-06-19 19:11:26 · 1194 阅读 · 0 评论 -
ZOJ--1057:Undercut
比较简单 直接上代码import java.util.Scanner;public class ZOJ_1057 { static int n,a,b,flag=0; static int arr[]=new int[20],brr[]=new int[20]; public static void main(String[] args) { Scanner s=new原创 2017-06-15 16:33:29 · 444 阅读 · 0 评论