自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

Hanylch

加油 !!!

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

原创 python requests 和正则表达式提取贴吧图片

通过requests的get方法得到对应url 的页面,然后直接使用re 的正则表达式来查找对应的图片的地址,最后将图片保存在本地。 新手,有很多不好的地方,欢迎交流import requestsimport sysimport ioimport reimport osurl = "http://c.tieba.baidu.com/p/5287949986"html=requests.ge

2017-09-13 15:17:39 1429

原创 多重背包(二进制优化)

类似于poj 1014 qduoj#include<bits/stdc++.h>#define maxn 100007using namespace std;int mm[20][20];int dp[maxn];int v[maxn];int w[maxn];int main(){ int n,m,t; scanf("%d",&t); while(t--)

2017-06-07 19:42:14 402

原创 Nested Segments CodeForces - 652D (树状数组,离散化)

You are given n segments on a line. There are no ends of some segments that coincide. For each segment find the number of segments it contains.Input The first line contains a single integer n (1 ≤ n ≤

2017-06-06 21:09:58 268

原创 B. Sagheer, the Hausmeister(codeforce 417 div2 B, dfs)

B. Sagheer, the Hausmeister time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Some people leave the lights at their workplaces on when they l

2017-06-02 17:38:00 322

原创 Sagheer and Nubian Market(二分)

time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output On his trip to Luxor and Aswan, Sagheer went to a Nubian market to buy some souvenirs for h

2017-06-02 09:15:33 764

原创 Hard Process CodeForces - 660C (尺取法)

You are given an array a with n elements. Each element of a is either 0 or 1.Let’s denote the length of the longest subsegment of consecutive elements in a, consisting of only numbers one, as f(a). You

2017-05-25 21:38:33 486

原创 The Smallest String Concatenation CodeForces - 632C (string sort)

You’re given a list of n strings a1, a2, …, an. You’d like to concatenate them together in some order such that the resulting string would be lexicographically smallest.Given the list of strings, outpu

2017-05-23 21:21:37 284

原创 Optimal Number Permutation CodeForces - 622D (找规律)

You have array a that contains all integers from 1 to n twice. You can arbitrary permute any numbers in a.Let number i be in positions xi, yi (xi < yi) in the permuted array a. Let’s define the value d

2017-05-18 21:39:31 298

原创 Pearls in a Row CodeForces - 620C

There are n pearls in a row. Let’s enumerate them with integers from 1 to n from the left to the right. The pearl number i has the type ai.Let’s call a sequence of consecutive pearls a segment. Let’s c

2017-05-18 21:37:16 324

原创 Not Equal on a Segment CodeForces - 622C (思维)

You are given array a with n integers and m queries. The i-th query is given with three integers li, ri, xi.For the i-th query find any position pi (li ≤ pi ≤ ri) so that api ≠ xi.Input The first line

2017-05-18 21:34:15 241

原创 Hdu 1176 免费馅饼 (动态规划)

免费馅饼Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 48350 Accepted Submission(s): 16755Problem Description 都说天上不会掉馅饼,但有一天gameboy正走在回家的小径上,忽

2017-05-17 21:52:34 182

原创 Piggy-Bank (hdu 1114 完全背包 模板)

Piggy-BankTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 24510 Accepted Submission(s): 12416Problem Description Before ACM can do anything

2017-05-17 20:48:56 214

原创 Andy的作业 FZU - 1404 (结果为大数的乘法)

Andy每天都有很多作业要做,他的老师总是在说“这些作业你明天必须交上来……”。现在他找你帮忙做其中的一项作业,给出N个整数A1, A2, …, AN,有 M 个询问 q (L, R),对于每个询问,你要输出一个整数,第L个数到第R个数的乘积,这个乘积不会超过1000位。Input 输入包含多组测试数据。每组数据第一行为两个整数N,M (N <= 800, M <= 1000) 接下来N行,给出这

2017-05-17 20:07:04 216

原创 中位数计数 (思维 + 技巧)

中位数计数Time Limit: 12000/6000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 1610 Accepted Submission(s): 583Problem Description 中位数定义为所有值从小到大排序后排在正中间的那个数,如果值有偶数个

2017-05-17 20:05:15 373

原创 Educational Codeforces Round 21 D. Array Division(前缀和,二分)

D. Array Division time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Vasya has an array a consisting of positive integer numbers. Vasya wants

2017-05-17 09:37:52 703

原创 Longest k-Good Segment CodeForces - 616D (尺取法)

The array a with n integers is given. Let's call the sequence of one or more consecutive elements in a segment. Also let's call the segment k-good if it contains no more than k different values.Find an

2017-05-16 23:54:28 299

原创 nyoj 448 删数字(思维水题)

寻找最大数 时间限制:1000 ms | 内存限制:65535 KB 难度:2 描述 请在整数 n 中删除m个数字, 使得余下的数字按原次序组成的新数最大,比如当n=92081346718538,m=10时,则新的最大数是9888输入 第一行输入一个正整数T,表示有T组测试数据 每组测试数据占一行,每行有两个数n,m(n可能是一个很大的整数,但其位数不超过100位,并且保证数据首位非

2017-05-15 21:28:40 415

原创 HEX(组合数+线性代数)

Problem DescriptionOn a plain of hexagonal grid, we define a step as one move from the current grid to the lower/lower-left/lower-right grid. For example, we can move from (1,1) to (2,1), (2,2) or (3,2

2017-05-10 21:52:03 349

原创 第八届山东acm省赛 C题 fireworks (组合数)

Problem DescriptionHmz likes to play fireworks, especially when they are put regularly. Now he puts some fireworks in a line. This time he put a trigger on each firework. With that trigger, each firew

2017-05-10 21:42:59 899

原创 Race to 1 Again (期望)

Rimi learned a new thing about integers, which is - any positive integer greater than 1 can be divided by its divisors. So, he is now playing with this property. He selects a number N. And he calls thi

2017-05-03 21:58:47 256

原创 Discovering Gold (期望,递推)

You are in a cave, a long cave! The cave can be represented by a 1 x N grid. Each cell of the cave can contain any amount of gold.Initially you are in position 1. Now each turn you throw a perfect 6 si

2017-05-03 21:57:50 202

原创 A Dangerous Maze ( 期望 )

You are in a maze; seeing n doors in front of you in beginning. You can choose any door you like. The probability for choosing a door is equal for all doors.If you choose the ith door, it can either ta

2017-05-03 21:56:34 281

原创 蓝桥杯 算法训练 Hankson的趣味题 (唯一分解定理)

算法训练 Hankson的趣味题 时间限制:1.0s 内存限制:64.0MB 提交此题 锦囊1 锦囊2 问题描述   Hanks 博士是BT (Bio-Tech,生物技术) 领域的知名专家,他的儿子名叫Hankson。现 在,刚刚放学回家的Hankson 正在思考一个有趣的问题。 今天在课堂上,老师讲解了如何求两个正整数c1 和c2 的最大公约数和最小公倍数。现 在Hankson

2017-05-02 18:53:19 917 1

原创 Bi-shoe and Phi-shoe LightOJ - 1370(欧拉函数+技巧)

Bamboo Pole-vault is a massively popular sport in Xzhiland. And Master Phi-shoe is a very popular coach for his success. He needs some bamboos for his students, so he asked his assistant Bi-Shoe to go

2017-04-27 21:39:41 257

原创 Prime Time UVA - 10200(打表)

Euler is a well-known matematician, and, among many other things, he discovered that the formula n 2 + n + 41 produces a prime for 0 ≤ n < 40. For n = 40, the formula produces 1681, which is 41 ∗ 41.

2017-04-27 21:37:28 273

原创 The Super Powers UVA - 11752 (素数分解)

We all know the Super Powers of this world and how they manage to get advantages in political warfare or even in other sectors. But this is not a political platform and so we will talk about a differe

2017-04-25 21:47:51 285

原创 Farey Sequence POJ - 2478(欧拉函数)

The Farey Sequence Fn for any integer n with n >= 2 is the set of irreducible rational numbers a/b with 0 < a < b <= n and gcd(a,b) = 1 arranged in increasing order. The first few are F2 = {1/2} F3

2017-04-25 21:42:19 186

原创 Kidnapping Gym - 101246E

input.txt / output.txt Statements Berland’s Police has a serious problem. A foreign ambassador arrived to Berland with an important mission, and his daughter was kidnapped just from the Royal Palace!

2017-04-21 23:57:34 276

原创 Maximum GCD UVA - 11827 (gcd ,输入)

Given the N integers, you have to find the maximum GCD (greatest common divisor) of every possible pair of these integers. Input The first line of input is an integer N (1 < N < 100) that determines

2017-04-20 17:49:10 340

原创 青蛙的约会 POJ - 1061 (拓展欧几里得算法)

两只青蛙在网上相识了,它们聊得很开心,于是觉得很有必要见一面。它们很高兴地发现它们住在同一条纬度线上,于是它们约定各自朝西跳,直到碰面为止。可是它们出发之前忘记了一件很重要的事情,既没有问清楚对方的特征,也没有约定见面的具体位置。不过青蛙们都是很乐观的,它们觉得只要一直朝着某个方向跳下去,总能碰到对方的。但是除非这两只青蛙在同一时间跳到同一点上,不然是永远都不可能碰面的。为了帮助这两只乐观的青蛙,你

2017-04-20 15:51:03 435

原创 Ada and Cycle SPOJ - ADACYCLE (bfs + 剪枝)

Ada the Ladybug is on a trip in Bugindia. There are many cities and some uni-directional roads connecting them. Ada is wondering about the shortest path, which begins in a city and ends in the same cit

2017-04-19 21:48:38 602

原创 Molly's Chemicals CodeForces - 776C ( 思维 + 前缀和)

Molly Hooper has n different kinds of chemicals arranged in a line. Each of the chemicals has an affection value, The i-th of them has affection value ai.Molly wants Sherlock to fall in love with her.

2017-04-17 20:47:11 1151

原创 Double Profiles CodeForces - 154C (hash)

You have been offered a job in a company developing a large social network. Your first task is connected with searching profiles that most probably belong to the same user.The social network contains n

2017-04-14 21:48:56 287

原创 Colliders CodeForces - 154B(分解素数)

By 2312 there were n Large Hadron Colliders in the inhabited part of the universe. Each of them corresponded to a single natural number from 1 to n. However, scientists did not know what activating sev

2017-04-14 20:07:37 364

原创 三分·三分求极值 HihoCoder - 1142

描述这一次我们就简单一点了,题目在此: week40_1.PNG 在直角坐标系中有一条抛物线y=ax^2+bx+c和一个点P(x,y),求点P到抛物线的最短距离d。 提示:三分法× 提示:三分法在之前的几周中我们了解到二分法作为分治中最常见的方法,适用于单调函数,逼近求解某点的值。 但当函数是凸形函数时,二分法就无法适用,这时就需要用到三分法。 从三分法的名字中我们可以猜到,三分法是

2017-04-12 20:44:34 421

原创 GCD - Extreme (II) UVA - 11426 (欧拉函数)

题目链接/* 看了挺久的,才大致看懂了是什么意思; 要求给定数的gcd(i,j) (1<=i<=j<=n) 因为数据很大,故打表是个选择 对于给定的n, a(n) = gcd(1,n)+gcd(2,n) +......+gcd(n-1,n) 故 结果为 sum(n) = a(2) + a(3) + a(4) + ...... + a(n); sum

2017-04-12 20:08:31 266

原创 Error Curves HDU - 3714 (三分求最值)

Josephina is a clever girl and addicted to Machine Learning recently. She pays much attention to a method called Linear Discriminant Analysis, which has many interesting properties. In order to t

2017-04-12 15:21:14 287

原创 NP-Hard Problem codeforces (二分图,dfs)

NP-Hard Problem time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Recently, Pari and Arya did some research about NP-Hard problems a

2017-04-12 15:12:16 379

原创 Trailing Zeroes (III) LightOJ - 1138 (数论,求n! 中某个数的个数)

You task is to find minimal natural number N, so that N! contains exactly Q zeroes on the trail in decimal notation. As you know N! = 1*2*…*N. For example, 5! = 120, 120 contains one zero on the trail.

2017-04-06 16:22:36 377

原创 Help Hanzo LightOJ - 1197

Amakusa, the evil spiritual leader has captured the beautiful princess Nakururu. The reason behind this is he had a little problem with Hanzo Hattori, the best ninja and the love of Nakururu. After hea

2017-04-06 11:45:08 261

空空如也

空空如也

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

TA关注的人

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