- 博客(23)
- 收藏
- 关注
原创 zoj 3946 Highway Project
Edward, the emperor of the Marjar Empire, wants to build some bidirectional highways so that he can reach other cities from the capital as fast as possible. Thus, he proposed the highway project.The Ma
2016-04-25 13:48:30 929
原创 zoj 3938 Defuse the Bomb
The bomb is about to explode! Please defuse it as soon as possible!There is a display showing a number from 1 to 4 on the bomb. Besides this, there are 4 buttons under the display. Each button is label
2016-04-23 23:58:13 447
原创 zoj 3944 People Counting
In a BG (dinner gathering) for ZJU ICPC team, the coaches wanted to count the number of people present at the BG. They did that by having the waitress take a photo for them. Everyone was in the photo a
2016-04-23 23:41:12 932
原创 hdu5670Machine
Problem Description There is a machine with m(2≤m≤30) coloured bulbs and a button.When the button is pushed, the rightmost bulb changes. For any changed bulb,if it is red now it will be green;if it i
2016-04-23 19:12:12 617
原创 fzuProblem 1010 Beavergnaw
Problem DescriptionWhen chomping a tree the beaver cuts a very specific shape out of the tree trunk. What is left in the tree trunk looks like two frustums of a cone joined by a cylinder with the diame
2016-04-21 17:59:00 420
原创 hdu 1129 Diophantus of Alexandria
Problem Description Diophantus of Alexandria was an egypt mathematician living in Alexandria. He was one of the first mathematicians to study equations where variables were restricted to integral valu
2016-04-17 15:05:14 392
原创 hdu 1102A + B Problem II
Problem Description I have a very simple problem for you. Given two integers A and B, your job is to calculate the Sum of A + B.Input The first line of the input contains an integer T(1<=T<=20) which
2016-04-12 21:16:38 243
原创 fzu 2128 最长子串
Problem 2128 最长子串 Accept: 184 Submit: 693 Time Limit: 3000 mSec Memory Limit : 65536 KB Problem Description 问题很简单,给你一个字符串s,问s的子串中不包含s1,s2…sn的最长串有多长。 Input输入包含多组数据。第一行为字符串s,字符串s的长度1到10^6次方,第二
2016-04-11 20:17:23 674
原创 湖南省多校对抗赛 Refract Facts
题意就是:给定飞机高度,潜艇深度,和折射,求最适合角度。 开始公式解不出,队友就2分法 求角度。#include<stdio.h> #include<math.h> #define pi 3.1415926535 #define eps 1e-6 double d,h,x,n1,n2; double find(double l,double r) { double q1,q2,mid;
2016-04-10 20:14:34 421
原创 湖南省多校对抗赛 Morse
题意:就是给定字符翻译。这算是常规题了。我的第一想法就map#include"iostream" #include"cstdio" #include"cstring" using namespace std; #define N 350 char al[N][50],biao[N][1000]; char s[N][N]; int n; void fun(){ //26个字母处理 int
2016-04-10 19:43:37 374
原创 Positive Con Sequences
题意就是:4个等比或等差的数,缺了一个,你要求出那个数。 思路:对每个位置考虑下#include"iostream" #include"cstdlib" #include"cmath" using namespace std; int main() { long long a,b,c,d,t,x; while(cin>>a>>b>>c>>d,a!=-1||b!=-1||c!=-1||d!=-
2016-04-10 19:31:39 579
原创 fzu 养鸡场
Problem DescriptionJason买来了n米长的竹篱笆,打算将n米长的竹篱笆全部用来围成一个三角形的养鸡场。为方便起见,养鸡场三条边的长度都为正整数。同时,他想让自己的养鸡场看起来更美观一些,要求三条边的长度分别在一个区间范围内。现在,他想知道有多少种不同的方案使得围成的养鸡场满足要求? Input输入包含多组数据。输入数据第一行是一个正整数n,表示竹篱笆的长度。在接下来三行中,第i
2016-04-09 23:40:10 521
原创 hdu1390Binary Numbers
Problem Description Given a positive integer n, find the positions of all 1’s in its binary representation. The position of the least significant bit is 0.ExampleThe positions of 1’s in the binary rep
2016-04-09 17:14:16 463
原创 hdu1021 Fibonacci Again
Problem Description There are another kind of Fibonacci numbers: F(0) = 7, F(1) = 11, F(n) = F(n-1) + F(n-2) (n>=2).Input Input consists of a sequence of lines, each containing an integer n. (n < 1,0
2016-04-09 16:34:12 321
转载 不用+,-,×,/做加法
转载于:http://www.cnblogs.com/python27/archive/2011/12/20/2295207.htmla=2进制的异或:保留本位,不进位。b= 2进制的或:刚好是保留进位。 a+b不会再有进位了。#include<iostream> #include<string> using namespace std;/*****************************
2016-04-09 10:47:46 303
转载 2叉树的非递归实现
装载于:http://blog.csdn.net/qq_20581563/article/details/51095639 //深度优先算法: void depthFirstSearch(Tree* root){ stack<Tree *> nodeStack; //使用C++的STL标准模板库 nodeStack.push(root);
2016-04-09 10:42:37 334
原创 面试题
int型数组,将数组里的元素连接拼成最大的数字,如[12,132,89,15]的输出是一个string:“891513212”。 分析:将int数组的元素化成char型的,然后进行字典序反排序。我的代码好像有点麻烦。#include<iostream> #include<cstring> #include<algorithm> #include<string> using namespace st
2016-04-09 10:38:37 433
原创 单片机 计数/定时 中断实验
计数/定时实验:方式2的计数器:T0来自P3.4引脚。方式2可以自动重装数进入,比较好用。 ORG 0000H LJMP START START: MOV TMOD,#00000110B MOV TH0,#255//初值 MOV TL0,#255 SETB TR0// 打开T0计数器 LP: JNB TF0,LP //没有溢
2016-04-09 10:31:34 1953
原创 hdu1379DNA Sorting
Problem Description One measure of unsortedness'' in a sequence is the number of pairs of entries that are out of order with respect to each other. For instance, in the letter sequenceDAABEC”, this me
2016-04-08 20:35:18 725
原创 hdu5437Alisha’s Party
Problem Description Princess Alisha invites her friends to come to her birthday party. Each of her friends will bring a gift of some value v, and all of them will come at a different time. Because the
2016-04-08 17:26:52 381
原创 FZU 2125 简单的等式
Problem Description 现在有一个等式如下:x^2+s(x,m)x-n=0。其中s(x,m)表示把x写成m进制时,每个位数相加的和。现在,在给定n,m的情况下,求出满足等式的最小的正整数x。如果不存在,请输出-1。 Input 有T组测试数据。以下有T(T<=100)行,每行代表一组测试数据。每个测试数据有n(1<=n<=10^18),m(2<=m<=16)。 分析:s(x,
2016-04-06 23:40:29 403
原创 hdu 1288Hat's Tea
Problem Description Hat is a member of PG Studio. Hat codes a lot and so he often buys tea at tea vending machine. But the tea vending machine just eat coins and spit out tea, if you feed the machine
2016-04-06 22:44:20 750
原创 fzu 2122 又见LKity
嗨!大家好,在TempleRun中大家都认识我了吧。我是又笨又穷的猫猫LKity。很高兴这次又与各位FZU的ACMer见面了。最近见到FZU的各位ACMer都在刻苦地集训,整天在日光浴中闲得发慌的我压力山大呀!于是,我准备为诸位编写一款小工具——LKity牌文本替换(众怒,:敢不敢更土点!)。这个小工具可以帮助诸位替换代码中的变量等功能,真心是一款编程,刷题必备的神器。其功能如下:将给定的字符序列中
2016-04-03 16:18:12 590
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人