自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

原创 1003 Emergency (25 分)

As an emergency rescue team leader of a city, you are given a special map of your country. The map shows several scattered cities connected by some r...

2019-10-20 11:14:42

阅读数 12

评论数 0

原创 1007 Maximum Subsequence Sum (25 分)

Given a sequence of K integers { N ​1 ​​ , N ​2 ​​ , …, N ​K ​​ }. A continuous subsequence is defined to be { N ​i ​​ , N ​i+1 ​​ , …, N ​j ​​ } w...

2019-10-19 15:51:12

阅读数 12

评论数 0

原创 1004 Counting Leaves (30 分)

A family hierarchy is usually presented by a pedigree tree. Your job is to count those family members who have no child. Input Specification: Each in...

2019-10-19 15:24:57

阅读数 11

评论数 0

原创 1009 Product of Polynomials (25 分)

This time, you are supposed to find A×B where A and B are two polynomials. Input Specification: Each input file contains one test case. Each case occ...

2019-10-13 10:38:33

阅读数 12

评论数 0

原创 G - 相遇周期 HDU - 1713

添加链接描述 2007年3月26日,在中俄两国元首的见证下,中国国家航天局局长孙来燕与俄罗斯联邦航天局局长别尔米诺夫共同签署了《中国国家航天局和俄罗斯联邦航天局关于联合探测火星-火卫一合作的协议》,确定中俄双方将于2009年联合对火星及其卫星“火卫一”进行探测。 而卫星是进行这些探测的重要工具...

2019-10-13 10:21:41

阅读数 50

评论数 0

原创 G - Hungry Canadian

添加链接描述 Teodoro just moved to Canada. He is having a hard time there as the cost of living is higher than he expected. He is short on money so he dec...

2019-09-27 20:29:40

阅读数 20

评论数 0

原创 Kangaroo Puzzle

地图上400个点,直接走一个50000的字符串。 用随机函数rand()%4产生四个方向的随机数。 关于rand添加链接描述 #include<bits/stdc++.h> using namespace std; char str[100][10000]; int a,b,c,d,e...

2019-09-27 17:26:28

阅读数 21

评论数 0

原创 A.Adrien and Austin

题目 只能拿连续的。 如果有奇数个,A先拿中间一个,B拿什么样的,A就对称着拿什么样的,这样A赢。 如果有偶数个,且b>1,A可以拿中间两个,又变成了和上面一样的情况,这样A赢。如果b=1,每次只能拿一个,可以拿偶数次,所以B赢。 注意特殊情况,如果一开始就是零个,A输。 #include&...

2019-09-27 17:12:04

阅读数 24

评论数 0

原创 Problem J. Jokewithpermutation

Input file: joke.in Output file: joke.out Joey had saved a permutation of integers from 1 to n in a text file. All the numbers were written as decima...

2019-09-27 16:48:50

阅读数 16

评论数 0

原创 Problem C: Sums

Jagiellonian University Kraków ACM ICPC Central Europe Regional Contest 2014 Problem C: Sums Given an integer 푁 , express it as the sum of at least t...

2019-09-24 20:57:29

阅读数 21

评论数 0

原创 C - Urn with Balls

C. Urn with Balls time limit per test 2.0 s memory limit per test 256 MB input standard input output standard output Megabrain has usual problems wit...

2019-09-20 19:58:41

阅读数 18

评论数 0

原创 D-jumps

D. Jumps time limit per test 2.0 s memory limit per test 256 MB input standard input output standard output A frog lives in a one-dimensiona...

2019-09-20 19:52:53

阅读数 20

评论数 0

原创 螺旋矩阵

题目链接 注意题目没有说k一定等于m*n,只是提到了行数m一定要大于等于n(如果k是素数,那有k行1列) #include<bits/stdc++.h> #include <iostream> using namespace std; int...

2019-09-17 20:36:28

阅读数 13

评论数 0

原创 最长公共子序列问题

Problem Description 给定两个序列 X={x1,x2,…,xm} 和 Y={y1,y2,…,yn},找出X和Y的最长公共子序列。 Input 输入数据有多组,每组有两行 ,每行为一个长度不超过500的字符串(输入全是大写英文字母(A,Z)),表示序列X和Y。 Output 每组输...

2019-09-17 20:01:20

阅读数 14

评论数 0

原创 最长上升子序列

一个数的序列bi,当b1 < b2 < … < bS的时候,我们称这个序列是上升的。对于给定的一个序列(a1, a2, …, aN),我们可以得到一些上升的子序列(ai1, ai2, …, aiK),这里1<= i1 < i2 < … < iK <=...

2019-09-17 19:51:32

阅读数 10

评论数 0

原创 Honk's pool

题目传送 As we all know, Honk has nnn pools, numbered as 111 ~ nnn . There is aia_iai​ liters water in the iii-th pool. Every day, Honk will perform the ...

2019-09-16 17:42:24

阅读数 10

评论数 0

原创 Light bulbs

题目传送 There are NNN light bulbs indexed from 000 to N−1N-1N−1. Initially, all of them are off. A FLIP operation switches the state of a contiguous sub...

2019-09-16 17:05:33

阅读数 14

评论数 0

原创 F - Purple Rain

题目传送 Purple rain falls in the magic kingdom of Linearland which is a straight, thin peninsula. On close observation however, Professor Nelson Rogers ...

2019-09-06 21:24:59

阅读数 20

评论数 0

原创 最大连续子序列之和

#include<bits/stdc++.h> #include<iostream> using namespace std; typedef long long ll; int a[100010]; int main() { ios::sync_wi...

2019-09-06 21:10:13

阅读数 23

评论数 0

原创 H Holy Grail(Spfa和Floyd)

As the current heir of a wizarding family with a long history,unfortunately, you find yourself forced to participate in the cruel Holy Grail War whic...

2019-09-03 21:01:25

阅读数 25

评论数 0

原创 二分找位置(如果元素不存在)

#include<bits/stdc++.h> using namespace std; int n; int a[110]; int mid(int k) { int l,r,mid; l=1; r=n; while(l<=r)...

2019-08-23 10:29:30

阅读数 17

评论数 0

原创 Rescue

题目传送 Angel was caught by the MOLIGPY! He was put in prison by Moligpy. The prison is described as a N * M (N, M <= 200) matrix. There are WALLs, R...

2019-08-22 20:43:30

阅读数 24

评论数 0

原创 1010同 Tempter of the Bone

题目传送 Problem Description The doggie found a bone in an ancient maze, which fascinated him a lot. However, when he picked it up, the maze began to sha...

2019-08-22 10:24:33

阅读数 15

评论数 0

原创 1016同 Prime Ring Problem

题目传送 #include<bits/stdc++.h> using namespace std; typedef long long ll; const int N=25; int vis[25]; int b[N]; int ans,n; bool prime(in...

2019-08-21 21:11:34

阅读数 20

评论数 0

原创 欧拉、埃氏、区间素数筛

1.埃氏素数筛(适用于1e6左右的数据,再大就明显慢了) 给你一个数n,让你求从1到n的所有素数。 如果n的范围很大,那一个数一个数判断是不是素数一定会超时。 素数筛:做一个从2到n的表,先全都标记成是素数。表里最小的数是2, 2是素数,把2的倍数全都划去(都不是素数),下一个最小的数是3,...

2019-08-21 09:06:54

阅读数 28

评论数 0

原创 I Older Brother

题目传送 I Older Brother Your older brother is an amateur mathematician with lots of experience. However, his memory is very bad. He recently got inte...

2019-08-20 19:23:42

阅读数 22

评论数 0

原创 C Brexit

题目传送 A long time ago in a galaxy far, far away, there was a large interstellar trading union, consisting of many countries from all across the gala...

2019-08-20 15:37:45

阅读数 26

评论数 0

原创 C. Almost Equal

C. Almost Equal time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output You are given integer n. You...

2019-08-19 19:22:28

阅读数 55

评论数 0

原创 2015 Syrian Private Universities Collegiate Programming Contest

A题(好吧他加载不出来) B题 把给的一个n*m的矩形切成一个个小方格,需要切n*m-1次,切奇数次是先手赢,偶数次先手输。 #include <stdio.h> #define ll long long int main() { int T,a,b; ...

2019-08-17 21:19:07

阅读数 21

评论数 0

原创 优先队列、map函数、pair简单应用

初接触,了解深了再加QWQ 一:pair pair是一个有两个元素的结构体,两个元素的类型可以不同。 定义: pair <int, string> p1; pair <char,string> p2; pair <string, vector< in...

2019-08-16 19:58:28

阅读数 54

评论数 0

原创 D - X and paintings

X is well known artist, no one knows the secrete behind the beautiful paintings of X except his friend Y, well the reason that Y knows X’s secrete is...

2019-08-16 19:30:27

阅读数 16

评论数 0

原创 J - X and Beasts

添加链接描述 X is fighting beasts in the forest, in order to have a better chance to survive he’s gonna buy upgrades for his weapon. Weapon upgrade shops a...

2019-08-16 15:12:28

阅读数 22

评论数 0

原创 E. Compress Words

博客 https://blog.csdn.net/weixin_42640692/article/details/99354903 https://blog.csdn.net/qq_41117236/article/details/99322891 题目 http://codef...

2019-08-15 15:07:01

阅读数 44

评论数 1

原创 kmp算法再理解

通过移动子串p来寻找p在s串中出现的位置。 next[j]用来记录当s[i]和p[j]匹配不成功时,j从next[j]开始重新匹配 next数组表示当前字符之前的字符串中,最长相同前后缀长度。 kmp算法步骤: 当j=-1(p串从头开始匹配)或者s[i]和p[j]匹配时,{ i++; j+...

2019-08-15 10:09:08

阅读数 23

评论数 0

原创 D. White Lines

题目 D. White Lines time limit per test1.5 seconds memory limit per test256 megabytes inputstandard input outputstandard output Gildong has bought a fa...

2019-08-14 20:13:36

阅读数 65

评论数 0

原创 D1. Submarine in the Rybinsk Sea (easy edition)

题目 D1. Submarine in the Rybinsk Sea (easy edition) time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard...

2019-08-14 17:04:27

阅读数 25

评论数 0

原创 C. Basketball Exercise

题目 C. Basketball Exercise time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Finally, a basket...

2019-08-14 16:48:59

阅读数 53

评论数 0

原创 Codeforces Round #578 (Div. 2) B、C

C题 C. Round Corridor time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Amugae is in a very lar...

2019-08-13 16:55:41

阅读数 28

评论数 0

原创 C - Planet Communcation

Lately the communication between planets has been an important issue, which is why the Earth has made many efforts to be connected to every other pla...

2019-08-13 16:17:47

阅读数 24

评论数 0

原创 J - Tangram

一块七巧板有 7 块,现在 wls 想再在七巧板上加 nn 条直线将七巧板切分并且使得切出来的块最多,请问最多能有多少块? Input 输入有多组(不超过 100, 000组)。 每组一行一个正整数 nn。 0 ≤ nn ≤ 1, 000, 000, 000 Output 每组输出一行一个数代表...

2019-08-08 20:25:16

阅读数 87

评论数 0

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