- 博客(31)
- 资源 (2)
- 收藏
- 关注
原创 SGU117—Counting (快速幂取模)
117. Counting time limit per test: 0.5 sec. memory limit per test: 4096 KB Find amount of numbers for given sequence of integer numbers such that after raising them to theM-th power they w
2013-11-28 20:36:28 1541
原创 SGU127-Telephone directory
127. Telephone directorytime limit per test: 0.5 sec. memory limit per test: 4096 KB CIA has decided to create a special telephone directory for its agents. The first 2 pages of the directory
2013-11-27 15:51:11 1153
原创 Codeforces Round #215 (Div. 2) -B. Sereja and Suffixes
B. Sereja and Suffixestime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputSereja has an array a, consisting of n intege
2013-11-27 11:05:21 1261
原创 Codeforces Round #215 (Div. 2) -A. Sereja and Coat Rack
Sereja owns a restaurant for n people. The restaurant hall has a coat rack withn hooks. Each restaurant visitor can use a hook to hang his clothes on it. Using thei-th hook costs ai rubles. Only o
2013-11-27 00:43:43 1714
原创 SGU112-a^b-b^a (BigNum)
You are given natural numbers a and b. Find ab-ba.InputInput contains numbers a and b (1≤a,b≤100). OutputWrite answer to output. Sample Input2 3Sample Output-1 分析
2013-11-26 08:22:40 1421
原创 Java大数处理
Ⅰ基本函数:1.valueOf(parament); 将参数转换为制定的类型 比如 int a=3; BigInteger b=BigInteger.valueOf(a); 则b=3; String s=”12345”; BigInteger c=BigInteger.value
2013-11-25 22:31:32 2029
原创 SGU113—— Nearly prime numbers
Nearly prime number is an integer positive number for which it is possible to find such primesP1 and P2 that given number is equal to P1*P2. There is given a sequence on N integer positive numbers
2013-11-22 22:02:02 1931
原创 SGU135——Drawing Lines(math)
Little Johnny likes to draw a lot. A few days ago he painted lots of straight lines on his sheet of paper. Then he counted in how many zones the sheet of paper was split by these lines. He noticed tha
2013-11-21 14:53:52 1631
原创 SGU107——987654321 problem
For given number N you must output amount of N-digit numbers, such, that last digits of their square is equal to 987654321. InputInput contains integer number N (16) OutputWrite answer
2013-11-21 11:31:05 2211
原创 SGU184——Patties
Petya is well-known with his famous cabbage patties. Petya's birthday will come very soon, and he wants to invite as many guests as possible. But the boy wants everybody to try his specialty of the ho
2013-11-20 11:27:15 1335
原创 SGU123——The sum(又见斐波那契)
The Fibonacci sequence of numbers is known: F1 = 1; F2 = 1; Fn+1 = Fn + Fn-1, for n>1.You have to find S - the sum of the first K Fibonacci numbers.InputFirst line contains natural number
2013-11-20 11:14:31 1468
原创 codeforces 365A——Good Number
Let's call a number k-good if it contains all digits not exceedingk (0, ..., k). You've got a numberk and an array a containingn numbers. Find out how many k-good numbers are in a (count each
2013-11-20 10:13:54 1783
原创 SGU105—— Div 3
105. Div 3 time limit per test: 0.5 sec. memory limit per test: 4096 KB There is sequence 1, 12, 123, 1234, ..., 12345678910, ... . Given first N elements of that sequence. You must determin
2013-11-19 16:55:49 1346
原创 SGU102——Coprimes (又见欧几里得)
102. Coprimes time limit per test: 0.5 sec. memory limit per test: 4096 KB For given integer N (1N104) find amount of positive numbers not greater than N that coprime with N. Let us call tw
2013-11-19 16:08:06 1453
原创 LA3135——Argus(优先队列)
DescriptionA data stream is a real-time, continuous, ordered sequence of items. Some examples include sensor data, Internet traffic, financial tickers, on-line auctions, and transaction logs s
2013-11-19 08:21:00 1618
原创 UVA11991——Easy Problem from Rujia Liu?(map+vector)
Though Rujia Liu usually sets hard problems for contests (for example, regional contests like Xi'an 2006, Beijing 2007 and Wuhan 2009, or UVa OJ contests like Rujia Liu's Presents 1 and 2), he occasio
2013-11-18 22:40:11 1513
原创 常用网络命令
Ping Ping是测试网络联接状况以及信息包发送和接收状况非常有用的工具,是网络测试最常用的命令。Ping向目标主机(地址)发送一个回送请求数据包,要求目标主机收到请求后给予答复,从而判断网络的响应时间和本机是否与目标主机(地址)联通。 如果执行Ping不成功,则可以预测故障出现在以下几个方面:网线故障,网络适配器配置不正确,IP地址不正确。如果执行Ping成功而网络仍无法使
2013-11-17 09:17:12 1332
原创 POJ1936——All in All
DescriptionYou have devised a new encryption technique which encodes a message by inserting between its characters randomly generated strings in a clever way. Because of pending patent issues we w
2013-11-13 15:47:10 1043
原创 strstr函数的用法
//包含文件:string.h//函数名: strstr//函数原型:extern char *strstr(char *str1, char *str2);//功能:从字符串str1中查找是否有字符串str2,如果有,从str1中的str2位置起,返回str1中str2起始位置的指针,如果没有,返回null。//返回值:返回该位置的指针,如找不到,返回空指针。#include#inc
2013-11-12 21:38:29 3450
原创 poj1035——Spell checker(串)
DescriptionYou, as a member of a development team for a new spell checking program, are to write a module that will check the correctness of given words using a known dictionary of all correct wor
2013-11-11 23:52:19 2387
原创 FZU-单词问题
Problem Description给出一个完整的句子,这个句子中不包含不可见字符或者空格,于是在这个句子中有许多不同的单词。一个单词是指一串连续的最长的英文字母(大写或小写)。例如"#abc#"中,"abc"就是一个单词,而"ab","bc"都不算单词。 Input输入包含多组数据 输入数据第一行是一个句子,只包含可见字符(不包含空格)。句子长度不超过 100。 Out
2013-11-10 23:48:23 1181
原创 FZU——数字游戏
Problem Description给一个N位的正整数,该数不包含前导0,先让你调整其中每个数字的位置,得到另一个n位的数,并且使得这个数越小越好,而且这个数不能包含前导0。比如543210可以变成102345,而12345保持不变才是最优结果。 Input第一行一个整数T(T每组数据先输入一行一个整数N(1 Output每组数据对应一行输出,即调整数
2013-11-10 17:05:28 1438
原创 FZU——上车
Problem Description有N个人排成一队按顺序上车,座位在前排并且排在队伍前面的人上车后会对座位在后面并且排他在后面的人造成阻碍。现给出每个人坐在第几排,假设这辆车有100排,每一排有100个座位。定义每个人的上车困难度为比这个人先上车并且座位在其前排的人数。问N个人的上车困难度之和。 Input第一行一个整数T(T每组数据先输入一行一个整数N(1
2013-11-10 17:03:13 1226
原创 zju——涨价了
题目描述小明所在的城市的出租车价又涨了。涨价之前,出租车的起步价为10元,可行驶3到公里。3公里后,每公里加2元,可行驶到10公里。10公里后,每公里加3元。等待费是每5分钟2元。乘客还需付1元的燃油费。涨价之后,出租车的起步价为11元,可行驶3到公里。3公里后,每公里加2.5元,可行驶到10公里。10公里后,每公里加3.75元。等待费是每4分钟2.5元。无燃油费。实际上,最后
2013-11-09 22:44:58 1743
原创 UVA11384—Help is needed for Dexter
Dexter is tired of Dee Dee. So he decided to keep Dee Dee busy in a game. The game he planned for her is quite easy to play but not easy to win at least not for Dee Dee. But Dexter does not have time
2013-11-09 22:24:33 1977
原创 HDU2578--Dating with girls(1) (map||排序+二分)
Problem DescriptionEveryone in the HDU knows that the number of boys is larger than the number of girls. But now, every boy wants to date with pretty girls. The girls like to date with the boys with
2013-11-06 19:30:32 1187
原创 快速排序
快速排序(Quicksort)是对冒泡排序的一种改进。由C. A. R. Hoare在1962年提出。它的基本思想是:通过一趟排序将要排序的数据分割成独立的两部分,其中一部分的所有数据都比另外一部分的所有数据都要小,然后再按此方法对这两部分数据分别进行快速排序,整个排序过程可以递归进行,以此达到整个数据变成有序序列。——摘自百度百科话说、大公司考快排、 快速排序由于排序
2013-11-05 21:36:38 962
原创 UVA11462-(Age sort)(计数排序)
You are given the ages (in years) of all people of a country with at least 1 year of age. You know that no individual in that country lives for 100 or more years. Now, you are given a very simple task
2013-11-04 20:11:11 1423
原创 UVA11384-Help is needed for Dexter
Dexter is tired of Dee Dee. So he decided to keep Dee Dee busy in a game. The game he planned for her is quite easy to play but not easy to win at least not for Dee Dee. But Dexter does not have time
2013-11-04 20:00:10 1353
原创 FZU-2088 最长队名(sort+字典)
DescriptionJack所在的班级决定组团报名参加FZU校赛。为了体现班级的团结和睦,班长决定用班级所有人的名字连起来组成一个史上最长最醒目的队名。因为听说在分数相同的情况下,队名字典序小的会排在更前面,班长还希望连成的史上最长队名拥有最小的字典序。Input输入数据第一行包含一个整数T,表示测试数据的组数。对于每组测试数据:第一行为一个整数n(0
2013-11-03 23:22:13 1505
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人