日常
DlPF_C
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
LeetCode4. Median of Two Sorted Arrays
题目链接:https://leetcode.com/problems/median-of-two-sorted-arrays/给出两个有序数组,求得两个数组的中位数。时间复杂度要log(n+m)。题意简单,但属实有些不好想。有序,时间复杂度要log。很容易想到二分。先考虑偶数的情况。数组可以分成两个部分。 left rightA[0],A[1],……A[i-1], | A[i],A[i+1],……A[n-1]B[0],B[1],…原创 2021-02-27 11:12:39 · 520 阅读 · 1 评论 -
CodeForce 446 Div.2 Wrath
Wrathtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputHands that shed innocent blood!There are n guilty原创 2017-11-18 12:58:40 · 402 阅读 · 0 评论 -
CodeForces - 808D Array Division
D. Array Divisiontime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputVasya has an array a consisting of positi原创 2017-08-04 19:58:13 · 453 阅读 · 0 评论 -
CodeForce Round 446 Pride
Pridetime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou have an array a with length n, you can perform原创 2017-11-18 12:54:16 · 383 阅读 · 0 评论 -
HDU 5245 期望概率
JoyfulTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1610 Accepted Submission(s): 707Problem DescriptionSakura has a very ma原创 2017-11-17 20:34:02 · 390 阅读 · 0 评论 -
2015新生赛莲花池
池子是细长条的,刚好有重量1~n的n条鱼,平时鱼儿们在池子里的相对位置不会改变,但是如果不按时喂它们,它们饿了就会吃仅比自己小一号的鱼。由于小鱼新陈代谢速度快,越小的鱼越早开始饿,也越早开始吃同类。包含多组输入数据,每组数据占一行, 输入以0结束。每组开始输入一个正整数n(1≤n≤10^6 )表示原本池子里共有n条鱼,之后n个正整数a_1,a_2,…,a_n分别表示在池子里每条鱼的重量原创 2017-11-17 20:12:50 · 445 阅读 · 0 评论 -
HDU 5938 Four Operations 模拟
题目链接:https://vjudge.net/problem/HDU-5938题意:输入一个字符串,从左到右依次插入+-×/,求所得的算式的最大值。题解:算式一定是a+b-c*d/e的形式,c和d只分配一个数,a+b最大的情况只有两种,然后从前向后枚举e的值。#includeusing namespace std;#define ll long longchar s[25];原创 2017-10-22 19:21:17 · 394 阅读 · 0 评论 -
UVALive - 3708 Graveyard
题目地址:点击打开链接题意: 一个周长长为10000的圈,里面原先等距离的放着n个雕塑,现在要往里再放m个雕塑,要求所有雕塑还是等距离,问移动原先已有雕塑的最短距离。思路:圆的位置记为0~10000,知道雕塑个数就知道雕塑该在的位置,暴力一下就出来了,注意要标记这个位置是否已经有雕塑。#include#define maxn 10000.0using namespace std;原创 2017-10-11 20:32:23 · 357 阅读 · 0 评论 -
CodeForces - 808C C. Tea Party (贪心)
C. Tea Partytime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputPolycarp invited all his friends to the tea par原创 2017-09-09 20:09:56 · 474 阅读 · 0 评论 -
HDU —5120 Intersection
IntersectionTime Limit: 4000/4000 MS (Java/Others) Memory Limit: 512000/512000 K (Java/Others)Total Submission(s): 3274 Accepted Submission(s): 1236Problem DescriptionMatt is a b原创 2017-09-09 19:53:18 · 350 阅读 · 0 评论 -
Coin 2017ICPC西安网络赛
原题链接:https://nanti.jisuanke.com/t/17115Bob has a not even coin, every time he tosses the coin, the probability that the coin's front face up is \frac{q}{p}(\frac{q}{p} \le \frac{1}{2})pq(p原创 2017-09-16 20:03:15 · 604 阅读 · 0 评论 -
HDU 5984 Pocky
PockyTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 689 Accepted Submission(s): 379Problem DescriptionLet’s talking about so原创 2017-08-29 19:49:12 · 449 阅读 · 0 评论 -
CodeForces - 730A Toda 2
A. Toda 2time limit per test2 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputA group of n friends enjoys playing popular video原创 2017-08-29 19:44:33 · 454 阅读 · 0 评论 -
HDU 6158 The Designer 笛卡尔定理+韦达定理 2017ccpc网络赛
The DesignerTime Limit: 8000/4000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1198 Accepted Submission(s): 233Problem DescriptionNowadays, litt原创 2017-08-23 16:29:01 · 655 阅读 · 0 评论 -
CodeForces - 814B An express train to reveries
B. An express train to reveriestime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputSengoku still remembers the原创 2017-08-25 12:00:00 · 503 阅读 · 0 评论 -
CodeForces - 793B Igor and his way to work dfs搜索
B. Igor and his way to worktime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputWoken up by the alarm clock Igo原创 2017-08-25 11:31:05 · 445 阅读 · 0 评论 -
CodeForces - 276B Little Girl and Game
B. Little Girl and Gametime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe Little Girl loves problems on g原创 2017-07-28 20:09:46 · 1651 阅读 · 0 评论 -
CodeForces - 383A Milking cows
A. Milking cowstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputIahub helps his grandfather at the farm. Tod原创 2017-07-28 19:27:46 · 384 阅读 · 0 评论 -
51Nod - 1267 4个数和为0
1267 4个数和为0基准时间限制:1 秒 空间限制:131072 KB 分值: 20 难度:3级算法题给出N个整数,你来判断一下是否能够选出4个数,他们的和为0,可以则输出"Yes",否则输出"No"。Input第1行,1个数N,N为数组的长度(4 <= N <= 1000)第2 - N + 1行:A[i](-10^9 O原创 2017-07-28 19:17:50 · 349 阅读 · 0 评论 -
UVALive - 3135 B - Argus
题目链接:https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=1136优先队列,设定一下优先级就好!#include#include#includeusing namespace std;struct Argus{ in原创 2017-07-28 17:01:11 · 384 阅读 · 0 评论 -
UVA - 11995 I Can Guess the Data Structure!
题目链接:https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=3146用队列,栈,优先队列,判断就好。不要自己拿数组模拟。对STL不熟悉就老想不到用。。。。自己模拟又找不出错,但就是过不了。。。。。。#include#include#include原创 2017-07-28 16:53:03 · 363 阅读 · 0 评论 -
CodeForces - 828D High Load
D. High Loadtime limit per test2 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputArkady needs your help again! This time he dec原创 2017-08-04 20:49:54 · 461 阅读 · 0 评论 -
CodeForces - 803D Magazine Ad
D. Magazine Adtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe main city magazine offers its readers an原创 2017-08-04 19:37:29 · 447 阅读 · 0 评论 -
CodeForces - 96D Volleyball 最短路
D. Volleyballtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputPetya loves volleyball very much. One day he原创 2018-01-29 19:33:37 · 709 阅读 · 0 评论 -
牛客多校第七场 C Bit Compression
链接:https://www.nowcoder.com/acm/contest/145/C来源:牛客网 题目描述A binary string s of length N = 2n is given. You will perform the following operation n times :- Choose one of the operators AND (&),...原创 2018-08-11 09:24:54 · 351 阅读 · 0 评论 -
杭电多校第三场 HDU 6319 Problem A. Ascending Rating (模拟单调队列)
Problem A. Ascending RatingTime Limit: 10000/5000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others)Total Submission(s): 3701 Accepted Submission(s): 1225 Problem DescriptionBe...原创 2018-07-31 20:59:50 · 366 阅读 · 0 评论 -
杭电多校第三场HDU6321 Problem C. Dynamic Graph Matching (状压DP)
Problem C. Dynamic Graph MatchingTime Limit: 8000/4000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others)Total Submission(s): 1238 Accepted Submission(s): 516 Problem Descript...原创 2018-07-31 20:47:11 · 322 阅读 · 0 评论 -
HDU 5929 Basic Data Structure 双向队列
Mr. Frog learned a basic data structure recently, which is called stack.There are some basic operations of stack: ∙∙ PUSH x: put x on the top of the stack, x must be 0 or 1. ∙∙ POP: throw the elemen...原创 2018-07-19 10:16:55 · 325 阅读 · 0 评论 -
ZOJ-4016 Mergeable Stack 链表模拟栈
题目:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=4016链表模拟 怕爆内存 把所有申请空间的指针都放到一个vector里消除 结果超时。。。 每次top的时候删除居然不会爆内存。。#include<bits/stdc++.h>#define maxn 100010#define ll long lon...原创 2018-04-09 16:56:53 · 325 阅读 · 0 评论 -
CodeForce 923A PromalSport
B. Primal Sporttime limit per test1.5 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAlice and Bob begin their day with a quick game. They first choose a starting num...原创 2018-03-17 10:33:39 · 438 阅读 · 0 评论 -
Codeforce 931 C. Laboratory Work
C. Laboratory Worktime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputAnya and Kirill are doing a physics laboratory work. In one of the tasks they hav...原创 2018-03-10 11:53:58 · 322 阅读 · 0 评论 -
Codeforces 950 C. Zebras
C. Zebrastime limit per test1 secondmemory limit per test512 megabytesinputstandard inputoutputstandard outputOleg writes down the history of the days he lived. For each day he decides if it was good ...原创 2018-03-10 11:39:23 · 556 阅读 · 0 评论 -
51Nod 1298 圆与三角形 计算几何
1298 圆与三角形题目来源: HackerRank基准时间限制:1 秒 空间限制:131072 KB 分值: 0 难度:基础题给出圆的圆心和半径,以及三角形的三个顶点,问圆同三角形是否相交。相交输出"Yes",否则输出"No"。(三角形的面积大于0)。Input第1行:一个数T,表示输入的测试数量(1 <=原创 2018-01-30 10:29:03 · 582 阅读 · 0 评论 -
HDU 2586 How far a way
勇气小镇是一个有着n个房屋的小镇,为什么把它叫做勇气小镇呢,这个故事就要从勇气小镇成立的那天说起了,修建小镇的时候,为了让小镇有特色,镇长特地只修了n-1条路,并且规定说,所有在勇气小镇的村民,每一次出门必须规划好路线, 路线必须满足在到达终点之前绝对不走回头路。每个人都要这样,不然那个人就不配在小镇生活下去,因为他没有这个勇气。事实上,这并不能算一项挑战,因为n-1条路已经连通了每户原创 2018-01-29 19:47:50 · 472 阅读 · 0 评论 -
CodeForce 898 C. Phone Numbers
C. Phone Numberstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputVasya has several phone books, in which he原创 2017-12-23 11:45:20 · 1823 阅读 · 0 评论 -
51Nod 1265 四点共面
1265 四点共面基准时间限制:1 秒 空间限制:131072 KB 分值: 0 难度:基础题给出三维空间上的四个点(点与点的位置均不相同),判断这4个点是否在同一个平面内(4点共线也算共面)。如果共面,输出"Yes",否则输出"No"。Input第1行:一个数T,表示输入的测试数量(1 <= T <= 1000)第2 - 4T +原创 2018-01-29 17:52:12 · 344 阅读 · 0 评论 -
树的遍历
题意:给出后序与中序遍历 输出层序遍历;输入样例:72 3 1 5 7 6 41 2 3 4 5 6 7输出样例:4 1 6 3 5 7 2后序遍历与中序遍历是有关系的,我们很容易在中序遍历中找到根节点的位置,左边n个数是左子树的中序遍历,右边m个数是右子树的中序遍历,相比较后序遍历,前n个数是左子树的后序遍历,之后的m个数是右子树的后序遍历。根据这原创 2018-01-19 19:30:29 · 328 阅读 · 0 评论 -
HDU 1556 Color the ball
Color the ballTime Limit: 9000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 24404 Accepted Submission(s): 11853Problem DescriptionN个气球排成一排,原创 2018-01-24 10:58:43 · 337 阅读 · 0 评论 -
CodeForce896 B. Ithea Plays With Chtholly
B. Ithea Plays With Chthollytime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputThis is an interactive problem.原创 2017-12-06 16:45:37 · 514 阅读 · 0 评论 -
CodeForce 907 A. Masha and Bears
A. Masha and Bearstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputA family consisting of father bear, moth原创 2017-12-24 09:22:54 · 1200 阅读 · 0 评论
分享