自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(362)
  • 收藏
  • 关注

原创 VHDL语言入门整理

1.2选1多路选择器Library ieee;Use ieee.std_logic_1164.all;Entity L1 isPort(a,b,s:in std_logic;y:out std_logic);End L1;Architecture one of L1 isBeginProcess(a,b,s)beginIf(s='0')then

2014-12-02 19:36:36 19298

原创 “浪潮杯”第五届ACM大学生程序设计竞赛

E:Factorial求阶乘#include #include #include using namespace std;int fun(int n){ int sum=1; for(int i=1;i<=n;i++) { sum*=i; } return sum;}int main(){ int t; cin>>t;

2014-05-13 19:52:07 963

原创 第六届华为创新杯编程大赛

A有一群兔子和鸽子,共有h个头,f只

2014-05-06 14:54:35 1199

原创 Count The Carries

Problem DescriptionOne day, Implus gets interested in binary addition and binary carry. He will transfer all decimal digits to binary digits to make the addition. Not as clever as Gauss, to make t

2014-05-06 13:53:34 634

原创 Codeforces Round #244 (Div. 2)——A. Police Recruits(水)

The police department of your city has just started its journey. Initially, they don’t have any manpower. So, they started hiring new recruits in groups.Meanwhile, crimes keeps occurring within th

2014-05-05 11:30:58 827

原创 Codeforces Round #243 (Div. 2)——A. Sereja and Mugs

Sereja showed an interesting game to his friends. The game goes like that. Initially, there is a table with an empty cup and n water mugs on it. Then all players take turns to move. During a move, a

2014-04-28 20:43:07 747

原创 K - Yet Another Story of Rock-paper-scissors

DescriptionAkihisa and Hideyoshi were lovers. They were sentenced to death by the FFF Inquisition. Ryou, the leader of the FFF Inquisition, promised that the winner of Rock-paper-scissors would be

2014-04-27 20:24:12 871

原创 D - Draw Something Cheat(水)

DescriptionHave you played Draw Something? It's currently one of the hottest social drawing games on Apple iOS and Android Devices! In this game, you and your friend play in turn. You need to pick

2014-04-27 19:53:45 733

原创 B. Megacity

The administration of the Tomsk Region firmly believes that it's time to become a megacity (that is, get population of one million). Instead of improving the demographic situation, they decided to ach

2014-04-27 16:20:42 640

原创 A. Squats

Pasha has many hamsters and he makes them work out. Today, n hamsters (n is even) came to work out. The hamsters lined up and each hamster either sat down or stood up.For another exercise, Pasha

2014-04-27 16:02:17 667

原创 数据结构之Chain类

//基于链表的类Chain#include using namespace std;//节点类,定义了每个节点的存储类型和指针名称templateclass ChainNode{public: T data; ChainNode *link;};//链表类,封装了链表操作的相应方法templateclass Chain{public: Chai

2014-04-21 19:40:23 1338

原创 B - Break Standard Weight

DescriptionThe balance was the first mass measuring instrument invented. In its traditional form, it consists of a pivoted horizontal lever of equal length arms, called the beam, with a weighing p

2014-04-16 20:10:52 513

原创 cf——A. Down the Hatch!

Everybody knows that the Berland citizens are keen on health, especially students. Berland students are so tough that all they drink is orange juice!Yesterday one student, Vasya and his mates made

2014-04-16 19:26:12 591

原创 Coder-Strike 2014 - Qualification Round——A. Password Check

You have probably registered on Internet sites many times. And each time you should enter your invented password. Usually the registration form automatically checks the password's crypt resistance. If

2014-04-15 18:54:55 702

原创 A. Guess a number!(cf)

A TV show called "Guess a number!" is gathering popularity. The whole Berland, the old and the young, are watching the show.The rules are simple. The host thinks of an integer y and the participan

2014-04-14 21:23:29 612

原创 J - What day is that day?(zoj水题)

ZOJ Problem Set - 3785What day is that day?Time Limit: 2 Seconds      Memory Limit: 65536 KBIt's Saturday today, what day is it after 11 + 22 + 33 + ... + NN days?InputThere are multip

2014-04-14 19:43:15 916

原创 L - Access System(水)

DescriptionFor security issues, Marjar University has an access control system for each dormitory building.The system requires the students to use their personal identification cards to open the g

2014-04-14 19:09:32 648

原创 G - Ternary Calculation(水)

DescriptionComplete the ternary calculation.InputThere are multiple test cases. The first line of input contains an integer T indicating the number of test cases. For each test case:

2014-04-14 19:05:16 1041

原创 poj——3159——Candies(spfa)

DescriptionDuring the kindergarten days, flymouse was the monitor of his class. Occasionally the head-teacher brought the kids of flymouse’s class a large bag of candies and had flymouse distrib

2014-04-10 18:11:25 537

原创 cf——C. Arithmetic Progression

Everybody knows what an arithmetic progression is. Let us remind you just in case that an arithmetic progression is such sequence of numbers a1, a2, ..., an of length n, that the following condition

2014-04-09 20:29:50 677

原创 cf——B. Number Busters

Arthur and Alexander are number busters. Today they've got a competition.Arthur took a group of four integers a, b, w, x (0 ≤ b w, 0 x w) and Alexander took integer с. Arthur and Alexander use d

2014-04-09 19:54:20 526

原创 ceil

ceil函数ceil的作用是求不小于给定实数的最小整数。ceil(2)=ceil(1.2)=cei(1.5)=2.00使用该函数需要包含头文件,该函数返回值为浮点型

2014-04-09 19:35:58 775

原创 CF——A. Ksenia and Pan Scales

InputThe first line has a non-empty sequence of characters describing the scales. In this sequence, an uppercase English letter indicates a weight, and the symbol "|" indicates the delimiter (th

2014-04-09 19:02:25 621

原创 cf——B. Mashmokh and Tokens

Bimokh is Mashmokh's boss. For the following n days he decided to pay to his workers in a new way. At the beginning of each day he will give each worker a certain amount of tokens. Then at the end o

2014-04-08 11:54:43 738

原创 cf——A. Mashmokh and Lights

Mashmokh works in a factory. At the end of each day he must turn off all of the lights.The lights on the factory are indexed from 1 to n. There are n buttons in Mashmokh's room indexed from 1 to

2014-04-08 11:17:21 688

原创 hdu——2586——How far away ?(lca)

Problem DescriptionThere are n houses in the village and some bidirectional roads connecting them. Every day peole always like to ask like this "How far is it if I want to go from house A to house

2014-04-08 10:53:44 481

原创 poj——1330——Nearest Common Ancestors(lca)

Language:DefaultNearest Common AncestorsTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 16384 Accepted: 8761DescriptionA rooted tree is a well-kno

2014-04-02 21:19:30 400

原创 C - YesOrNo

DescriptionA国认为如果字符串a可以通过操作X变成字符串b,就认为是一样的字符串。操作X:将字符串分为两部分,然后调换位置,操作次数不限。W=xy,W’=yx。Input有多组测试数据,处理到文件结尾。每组测试数据包含两个个字符串(包含英文字符和数字,长度为[1,500000])。Output对于每组测试数据,如果两个字符串是相同的,输出Y

2014-04-02 21:16:56 749

原创 cf——A. The Great Game

Two teams meet in The Game World Championship. Some scientists consider this game to be the most intellectually challenging game in the world. You are given two strings describing the teams' actions i

2014-04-02 16:02:53 572

原创 cf——Candies——(spfa)

DescriptionDuring the kindergarten days, flymouse was the monitor of his class. Occasionally the head-teacher brought the kids of flymouse’s class a large bag of candies and had flymouse distrib

2014-04-02 10:27:38 523

原创 cf——C. Insertion Sort

Petya is a beginner programmer. He has already mastered the basics of the C++ language and moved on to learning algorithms. The first algorithm he encountered was insertion sort. Petya has already wri

2014-04-01 15:01:19 462

原创 cf——C. Triangle(三角形的顶点)

There is a right triangle with legs of length a and b. Your task is to determine whether it is possible to locate the triangle on the plane in such a way that none of its sides is parallel to the co

2014-04-01 11:08:32 579

原创 A. Slightly Decreasing Permutations

#include #include #include #include using namespace std;int main(){ int n,m; while(scanf("%d%d",&n,&m)!=EOF) { if(m==0) { for(int i=1;i<n;i++)

2014-03-31 18:44:00 613

原创 cf——B. Garland

Once little Vasya read an article in a magazine on how to make beautiful handmade garland from colored paper. Vasya immediately went to the store and bought n colored sheets of paper, the area of ea

2014-03-30 18:31:31 637

原创 cf——H - Vanya and Cards

The Little Elephant has an integer a, written in the binary notation. He wants to write this number on a piece of paper.To make sure that the number a fits on the piece of paper, the Little Elepha

2014-03-30 08:48:11 561

原创 C. Hexadecimal's Numbers

One beautiful July morning a terrible thing happened in Mainframe: a mean virus Megabyte somehow got access to the memory of his not less mean sister Hexadecimal. He loaded there a huge amount of n di

2014-03-27 16:35:18 939

原创 A. Kalevitch and Chess

A famous Berland's painter Kalevitch likes to shock the public. One of his last obsessions is chess. For more than a thousand years people have been playing this old game on uninteresting, monotonous

2014-03-27 13:06:13 961

原创 cf——B. Domino Effect

Little Chris knows there's no fun in playing dominoes, he thinks it's too random and doesn't require skill. Instead, he decided to play withthe dominoes and make a "domino show".Chris arranges n d

2014-03-27 12:46:35 501

原创 cf——A. Unusual Product

Little Chris is a huge fan of linear algebra. This time he has been given a homework about the unusual square of a square matrix.The dot product of two integer number vectors x and y of size n i

2014-03-27 11:39:31 455

原创 c++运算符

C/C++位操作运算符操作符功能用法~位求反~expr左移expr1 >>右移expr1 >> expr2&位与expr1 & expr2^位异或expr1 ^ expr2|位或

2014-03-27 08:49:51 439

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除