自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

博客的乐园

越强大,越冷静

  • 博客(25)
  • 收藏
  • 关注

原创 买啤酒

题目:两元一瓶啤酒,两个啤酒瓶可换一瓶啤酒,四个啤酒瓶盖可换一瓶啤酒,求10元可以买几瓶啤酒。 1,不允许借瓶子的情况下 #include #include int sum = 0; int gai = 0; int ping = 0; void he(int n){ sum += n; gai += n; ping += n; if(gai < 4

2017-06-02 20:49:23 579

原创 PHP实现几种常见的排序

<?php ini_set("error_reporting","E_ALL & ~E_NOTICE"); /** * 冒泡排序 */ function bubbleSort($arr) { $len = count($arr); for($i=1; $i<$len; $i++){ for($j=0; $j<$len-$i; $j++){ if($arr[$j] > $arr[

2017-05-24 16:19:29 482

原创 nyoj 545 Metric Matrice

Metric Matrice 时间限制:1000 ms  |  内存限制:65535 KB 难度:1 描述 Given as input a square distance matrix, where a[i][j] is the distance between point i and point j, determine if the distance matrix is "a

2016-05-18 20:57:51 368

原创 nyoj 1112 求次数

求次数 时间限制:1000 ms  |  内存限制:65535 KB 难度:2 描述 题意很简单,给一个数n 以及一个字符串str,区间【i,i+n-1】 为一个新的字符串,i 属于【0,strlen(str)】如果新的字符串出现过ans++,例如:acmacm n=3,那么 子串为acm cma mac acm ,只有acm出现过 求ans; 输入

2016-05-18 17:01:08 238

原创 poj 1256 Anagram

Anagram Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 19889   Accepted: 7945 Description You are to write a program that has to generate all possible words

2016-05-18 14:11:25 229

原创 nyoj 542 试 制 品

试 制 品                                                                                           时间限制:1000 ms  |  内存限制:65535 KB

2016-05-16 14:10:53 492

原创 hdu 5256 序列变换(最长上升子序列&&二分)

序列变换 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 1233    Accepted Submission(s): 460 Problem Description 我们有一个数列A1,A2...An,你现在要

2016-05-12 21:48:47 286

原创 hdu 3501 Calculation 2 (欧拉函数的延伸)

Calculation 2 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 3422    Accepted Submission(s): 1413 Problem Description Given a posi

2016-05-12 21:10:59 225

原创 nyoj 781 又见回文数

又见回文数 时间限制:1000 ms  |  内存限制:65535 KB 难度:3 描述 冷淡的回文数被水了,各种被水,然后他很生气,然后... 一个数从左边读和从右边读一样,就说这个数是回文数。如121就是一个回文数。 这个简单了点,咱们这样规定:给定一个十进制数,你判断一下在二~十六进制下她是否是回文数,你能征服她吗? 如17用十进制表示它不是

2016-05-12 18:07:58 499

原创 nyoj 1023 还是回文 (区间dp加贪心)

还是回文 时间限制:2000 ms  |  内存限制:65535 KB 难度:3 描述 判断回文串很简单,把字符串变成回文串也不难。现在我们增加点难度,给出一串字符(全部是小写字母),添加或删除一个字符,都会产生一定的花费。那么,将字符串变成回文串的最小花费是多少呢? 输入多组数据 第一个有两个数n,m,分别表示字符的种数和字符串的长度 第二行给出一串

2016-05-12 14:51:02 399

原创 nyoj 930 回文数猜想

回文数猜想 时间限制:2000 ms  |  内存限制:65535 KB 难度:2 描述一个正整数,如果从左向右读(称之为正序数)和从右向左读(称之为倒序数)是一样的,这样的数就叫回文数。任取一个正整数,如果不是回文数,将该数与他的倒序数相加,若其和不是回文数,则重复上述步骤,一直到获得回文数为止。例如:68变成154(68+86),再变成605(154+451),最后变

2016-05-12 10:35:25 580

原创 nyoj 495 少年 DXH

少年 DXH 时间限制:1000 ms  |  内存限制:65535 KB 难度:2 描述大家都知道,DXH 幼时性格怪癖,小朋友都不喜欢和他玩,这种情况一直到 DXH 的少年时期也没有改变。 少年时期的 DXH 迷上了"回文串",“回文串”是指正着读倒着读都一样的字符串。DXH一个人的时候喜欢在地上随便写一个字符串 S,然后在这个字符串的右边添加尽量少的字符(可以不添

2016-05-11 21:19:55 512

原创 bnuoj 20950 沉重的货物 (最小生成树)

沉重的货物               Time Limit: 1000ms                                       Memory Limit: 65536KB  64-bit integer IO format: %lld      Java class name: Main   CUITCPC是一个专门生产大型货运火车的工厂。他们的新

2016-05-11 20:34:44 448

原创 H. Happy Reversal

H. Happy Reversal Time Limit: 1000ms Memory Limit: 65536KB Submit Status PID: 34988 Elfness is studying in an operation "NOT". For a binary number A, if we do operation "NOT A", after

2016-05-11 17:35:19 192

原创 uva 10566 Crossed ladders(二分 + 几何)

Crossed ladders Time Limit: 1000ms Memory Limit: 32768KB A narrow street is lined with tall buildings. An x foot long ladder is rested at the base of the building on the right side of the s

2016-05-11 16:01:47 257

原创 fzu 1150 Farmer Bill's Problem

Problem 1150 Farmer Bill's Problem Accept: 877    Submit: 1805 Time Limit: 1000 mSec    Memory Limit : 32768 KB  Problem Description Peter has n cigarettes. He smokes them one by one keepi

2016-05-11 15:09:43 564

原创 poj 2506 Tiling && nyoj 429 骨牌铺方格

这两个题目都属于高精度问题,只是递推公式不同,nyoj上的题目用long long 就可以过,但是题型相似,做法也一样 Tiling Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 8761   Accepted: 4209 Description

2016-05-11 14:53:10 236

原创 nyoj 312 20岁生日

20岁生日 时间限制:1000 ms  |  内存限制:65535 KB 难度:1 描述路过这的20岁生日就要到了,他当然很开心,可是他突然想到一个问题,是不是每个人从出生开始,到达20岁生日时所经过的天数都是一样的呢?似乎并不全都是这样,所以他想请你帮忙计算一下他和他的几个朋友从出生到达20岁生日所经过的总天数,让他好来比较一下。 输入一个数T,后面T行每行有

2016-05-11 14:42:32 352

原创 poj 3253 Fence Repair

Fence Repair Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 37649   Accepted: 12210 Description Farmer John wants to repair a small length of the fence arou

2016-05-10 17:41:16 653

原创 nyoj 308 Substring

Substring 时间限制:1000 ms  |  内存限制:65535 KB 难度:1 描述 You are given a string input. You are to find the longest substring of input such that the reversal of the substring is also a substrin

2016-05-10 16:40:46 395

原创 poj 1852 Ants(贪心)

Ants Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 14061   Accepted: 6134 Description An army of ants walk on a horizontal pole of length l cm, each with a

2016-05-10 14:19:05 587

原创 poj 2431 Expedition (贪心加优先队列)

Expedition Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 11538   Accepted: 3336 Description A group of cows grabbed a truck and ventured on an expedition d

2016-05-10 13:44:31 527

转载 欧拉函数小结

在数论,对正整数n,欧拉函数是小于n的数中与n互质的数的数目。 例如φ(8)=4,因为1,3,5,7均和8互质 欧拉公式的延伸:一个数的所有质因子之和是euler(n)*n/2。 直接求解欧拉函数 int euler(int n){ int res=n,a=n; for(int i=2;i*i<=a;i++){ if(a%i==0){

2016-05-06 17:39:04 276

原创 nyoj 290 动物统计加强版(RS哈希)

动物统计加强版 时间限制:3000 ms  |  内存限制:150000 KB 难度:4 描述在美丽大兴安岭原始森林中存在数量繁多的物种,在勘察员带来的各种动物资料中有未统计数量的原始动物的名单。科学家想判断这片森林中哪种动物的数量最多,但是由于数据太过庞大,科学家终于忍受不了,想请聪明如你的ACMer来帮忙。 输入第一行输入动物名字的数量N(1 输出输出

2016-05-06 16:15:00 259

原创 文章标题

Time Limit: 0.1 seconds (C/C++) Memory Limit: 256 megabytes You are given two natural numbers A and B. Determine the natural number N such that the least common multiple of the numbers A + N and B +

2016-05-06 14:23:41 200

空空如也

空空如也

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

TA关注的人

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