自定义博客皮肤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)
  • 收藏
  • 关注

原创 Codeforces Round #426 (Div. 2) C:The Meaningless Game(思维)

C. The Meaningless Game time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard outputSlastyona and her loyal dog Pushok are playing a meaningless game tha

2017-07-31 21:18:06 398

原创 Codeforces Round #426 (Div. 2)(A+B)

A. The Useless Toy time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard outputWalking through the streets of Marshmallow City, Slastyona have spotted so

2017-07-31 21:00:31 211

转载 hdu 6035 Colorful Tree

题目地址 题意:定义每条边的价值为边上不同颜色的个数,求整棵树的价值。 题解:这里写链接内容 代码:#include<iostream>#include<stdio.h>#include<stdlib.h>#include<string.h>#include<vector>#include<queue>#include<set>#include<algorithm>#inclu

2017-07-29 12:02:02 209

转载 hdu6038 Function

题目地址 题意:给你一个a序列,代表0到n-1的排列;一个b序列代表0到m-1的排列。问你可以找出多少种函数关系,满足f(i)=b[f(a[i])]; 官方题解:QAQ 代码:#include<iostream>#include<stdio.h>#include<stdlib.h>#include<string.h>#include<vector>#include<queue>#

2017-07-29 10:35:05 253

转载 HDU 6034 Balala Power!(贪心)

题目地址 题意:给a-z不同的的值(0-25),将下面的字符串看成一个26进制数,求字符串和转化成十进制的最大值,注意如果一个字符串长度>1,则首字母不能赋值成0。 题解:贪心的想,肯定是高位出现次数多的字母赋大值,我们找一个没出现在首字母并且赋值小的,让它为0. 代码:#include<iostream>#include<stdio.h>#include<stdlib.h>#inclu

2017-07-28 15:17:01 247

原创 2017 Multi-University Training Contest - Team 1(A+K)

A:A题地址 题意:对于给定的n,找到最大的k使得10^k<=2^n. 题解:等式两边同时取log(10)变成k<=log(10)2^n. 代码:#include<iostream>#include<stdio.h>#include<stdlib.h>#include<string.h>#include<vector>#include<queue>#include<algorith

2017-07-25 20:30:23 201

原创 Codeforces Round #425 (Div. 2)(A+B)

A. Sasha and Sticks time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output It’s one more school day now. Sasha doesn’t like classes and is always

2017-07-25 12:47:37 338

转载 FZU Problem 2280 Magic(Hash)

Problem 2280 Magic Accept: 46 Submit: 150 Time Limit: 2000 mSec Memory Limit : 262144 KBProblem DescriptionKim is a magician, he can use n kinds of magic, number from 1 to n. We use string Si t

2017-07-24 16:43:26 598

原创 第八届福建省大学生程序设计竞赛-重现赛(F Problem 2277 Change)DFS序+树状数组

Problem 2277 Change Accept: 38 Submit: 241 Time Limit: 2000 mSec Memory Limit : 262144 KBProblem DescriptionThere is a rooted tree with n nodes, number from 1-n. Root’s number is 1.Each node ha

2017-07-23 16:39:43 552

原创 第八届福建省大学生程序设计竞赛-重现赛(A+D+K+L)

Problem A Frog:鸡兔同笼。。。。Problem D Game:两人分别有数字a,b。每轮两人有两种操作,1:逆序这个数。2:将个位删去。A先手,当两个数字相同时,A获胜。问A能否获胜。 题解:如果b的位数大于a,B获胜。如果B为0,A获胜。如果b是a的逆序,A获胜,其他情况,如果b是a或者逆序a的子串,A获胜。 代码:忘存了。。。。Problem K Wand:n个人排序,至少k个

2017-07-22 22:20:45 1214

原创 倍增lca

void dfs(int u,int f,int d){ deep[u]=d; for(int i=head[u];i!=-1;i=edge[i].next) { int v=edge[i].to; if(v==f)continue; anc[v][0]=u; dfs(v,u,d+1); }}voi

2017-07-21 15:39:56 246

转载 hdu 6031 Innumerable Ancestors(LCA+二分)

Innumerable AncestorsTime Limit: 10000/5000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others) Total Submission(s): 901 Accepted Submission(s): 270Problem Description There is a tree

2017-07-21 15:36:18 246

原创 HDU 6024 Building Shops(DP)

Problem Description HDU’s n classrooms are on a line ,which can be considered as a number line. Each classroom has a coordinate. Now Little Q wants to build several candy shops in these n classrooms.T

2017-07-19 22:32:44 276

原创 矩阵快速幂

struct Matrix{ ll m[sz][sz];};Matrix Mul(Matrix a,Matrix b){ Matrix c; memset(c.m,0,sizeof(c.m)); for(int i=0; i<sz; i++) for(int j=0; j<sz; j++) for(int k=0; k<

2017-07-19 19:19:07 164

转载 sichuan2017 E. Longest Increasing Subsequence(LIS变形)

E. Longest Increasing Subsequence Bobo learned how to compute Longest Increasing Subsequence (LIS) in O(n log n) in ICPCCamp. For those who did not attend ICPCCamp as Bobo, recall LIS(a1, a2, … , an)

2017-07-19 13:15:15 318

转载 FZU Problem 2271 X(最短路)

Problem DescriptionX is a fully prosperous country, especially known for its complicated transportation networks. But recently, for the sake of better controlling by the government, the president Fat B

2017-07-19 10:33:13 711

原创 Sichuan 2017 FSimple Algebra(打表)

F. Simple Algebra Given function f(x, y) = ax2 + bxy + cy2 , check if f(x, y) ≥ 0 holds for all x, y ∈ R. Input The input contains zero or more test cases and is terminated by end-of-file. Each te

2017-07-18 22:27:07 394

原创 Fzu Problem 2253 Salty Fish(dp)

Problem 2253 Salty Fish Accept: 50 Submit: 166 Time Limit: 1000 mSec Memory Limit : 32768 KBProblem Description海边躺着一排咸鱼,一些有梦想的咸鱼成功翻身(然而没有什么卵用),一些则是继续当咸鱼。一个善良的渔夫想要帮这些咸鱼翻身,但是渔夫比较懒,所以只会从某只咸鱼开始,往一个

2017-07-18 11:51:50 332

转载 Codeforces Round #424 (Div. 2) E. Cards Sorting(树状数组)

E. Cards Sorting time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Vasily has a deck of cards consisting of n cards. There is an integer on e

2017-07-18 11:08:42 317

原创 玲珑杯 1146 图论你先敲完模板(DP)

C – 图论你先敲完模板 DESCRIPTION HH作为一个爱运动的人,肯定会想方设法把跑步所消耗的能量减到最少. 现在这个操场上n个可以休息的点,他们的坐标分别为x1,x2…xn(xi≤xi+1), HH刚开始在 x1 ,并且他只能在这些点休息,在中途不能停下来,否则会因为旁边的音浪太强而被晃到. 如果HH连续跑一段长度为l的距离,那么他将会消耗2^l+a的能量(a为HH的可爱值)

2017-07-16 11:26:30 234

原创 玲珑杯 1143 - 计算几何你瞎暴力

1143 - 计算几何你瞎暴力 Time Limit:5s Memory Limit:256MByteSubmissions:1735Solved:341DESCRIPTION 今天HH考完了期末考试,他在教学楼里闲逛,他看着教学楼里一间间的教室,于是开始思考:如果从一个坐标为 (x1,y1,z1)的教室走到(x2,y2,z2)的距离为 |x1−x2|+|y1−y2|+|z1−z2|那么有多少对

2017-07-16 10:26:51 213

原创 FZU Problem 2256 迷宫(dfs序)

Problem 2256 迷宫 Accept: 7 Submit: 14 Time Limit: 1500 mSec Memory Limit : 32768 KBProblem Description某一天,YellowStar在人生的道路上迷失了方向,迷迷糊糊之中,它误入了一座迷宫中,幸运的是它在路口处发现了一张迷宫的地图。经过它的观察,它发现这个迷宫一共有n个房间,并且这n个房

2017-07-15 11:54:03 323

原创 Codeforces Round #424 D. Office Keys(二分)

D. Office Keys time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output There are n people and k keys on a straight line. Every person wants to get

2017-07-14 18:22:09 766

原创 Codeforces Round #424 C. Jury Marks (思维?)

C. Jury Marks time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Polycarp watched TV-show where k jury members one by one rated a participant

2017-07-14 13:47:34 336

原创 Codeforces Round #424(A+B)

Array of integers is unimodal, if:it is strictly increasing in the beginning; after that it is constant; after that it is strictly decreasing. The first block (increasing) and the last block (decrea

2017-07-14 13:20:34 411

空空如也

空空如也

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

TA关注的人

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