ACdream的人生
文章平均质量分 65
ZSGG_ACM
既然选择了ACM了,那就好好爱它,不管风雨兼程.
展开
-
1202 子序列个数
1202 子序列个数子序列的定义:对于一个序列a=a[1],a[2],......a[n]。则非空序列a'=a[p1],a[p2]......a[pm]为a的一个子序列,其中1例如4,14,2,3和14,1,2,3都为4,13,14,1,2,3的子序列。对于给出序列a,有些子序列可能是相同的,这里只算做1个,请输出a的不同子序列的数量。由于答案比较大,输出Mod 10^9原创 2016-06-13 00:56:09 · 1809 阅读 · 0 评论 -
87. Scramble String
点击打开题解链接原创 2016-03-04 23:20:19 · 555 阅读 · 0 评论 -
新博客地址,欢迎你们!
Welcome To My Blog!原创 2016-03-03 11:06:45 · 544 阅读 · 0 评论 -
链表判圈算法
题面: 判断一个单链表是否包含一个环; 解法:Floyd判圈算法可以解决此问题;这里提供另外一种算法,当然这种算法只能判断是否有环,并不能求出环的长度;1、很容易明白当一个链成环时,它会绕着指针回到环的起点;2、那么当我们把环的起点的指针反向指回去的时候,我们就可以顺利找到链表的起点;3、看到这里应该是很明白了,我们通过把指针反向指回去,如果当指针又原创 2016-01-31 10:48:40 · 877 阅读 · 0 评论 -
微软笔试题《Spring Outing》
新博客地址原创 2016-03-01 12:54:41 · 897 阅读 · 0 评论 -
25. Reverse Nodes in k-Group
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */class Solution {public: typedef pai原创 2016-02-08 18:36:07 · 559 阅读 · 0 评论 -
用Windows API 编写的简单贪吃蛇游戏
一、基础知识笔记 一种结构体,用于在控制台屏幕上定位一个字符的坐标。 应用程序中的不同对象和同类中的不同的实例,增加了系统对引用对象的控制,句柄不是指针,但是功能类似指针。 SetConsoleCursorPosition(HANDLE Hout,COORD pos),定位光标的地址。 SetConso原创 2015-12-06 15:18:21 · 3849 阅读 · 0 评论 -
2015年广东工业大学编译原理课设
一、PL/0编译程序的总流程图二、扩充赋值运算:*=,/=原创 2015-12-21 12:28:19 · 3360 阅读 · 7 评论 -
win10提示没有注册类,什么都打不开了
@ 调出任务管理器,点击服务,右键点击任意一个服务,打开服务,找到user Manager开头的一个服务,设置成自动,注销,开机就可以了。原创 2015-12-17 22:23:41 · 21279 阅读 · 1 评论 -
单调栈的运用
E - ETime Limit:1000MS Memory Limit:131072KB 64bit IO Format:%lld & %lluSubmitStatusDescriptionGiven n positive integers representing the histogram's bar height where the width o原创 2016-01-17 16:20:06 · 654 阅读 · 0 评论 -
1670 打怪兽
1670 打怪兽题目来源: 原创 基准时间限制:1 秒 空间限制:131072 KB 分值: 40 难度:4级算法题 收藏 关注lyk在玩一个叫做“打怪兽”的游戏。游戏的规则是这样的。lyk一开始会有一个初始的能量值。每次遇到一个怪兽,若lyk的能量值>=怪兽的能量值,那么怪兽将会被打败,lyk的能量值增加1,否则lyk死亡,游戏结束。若怪兽全部原创 2016-05-14 09:21:55 · 1714 阅读 · 0 评论 -
1282 时钟
1282 时钟题目来源: Codility 基准时间限制:1 秒 空间限制:131072 KB 分值: 40 难度:4级算法题 收藏 关注有N个时钟,每个时钟有M个指针,P个刻度。时钟是圆形的,P个刻度均分整个圆。每个时钟每个指针指向整数刻度,并且每个时钟自身指针指向的数字都不同。你可以任意旋转时钟的表盘,但是你不能转指针。问最后有多少对时钟可以变成原创 2016-05-03 22:22:09 · 768 阅读 · 0 评论 -
中位数计数
中位数计数Time Limit: 12000/6000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 826 Accepted Submission(s): 324Problem Description中位数定义为所有值从小到大排序后排在正中间原创 2016-05-27 12:15:16 · 1396 阅读 · 2 评论 -
C. Foe Pairs
C. Foe Pairstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given a permutation p of length n. Al原创 2016-06-11 12:03:35 · 1083 阅读 · 0 评论 -
素数生成器
#!/usr/bin/python3#coding=utf-8__author__ = 'xdlove''素数生成器'#奇数生成器(不包括1)生成的是一个无限序列def odd_list(): n = 1 while True: n += 2 yield n#过滤因子---def filter_not_prime(n):原创 2016-06-04 15:36:54 · 3695 阅读 · 0 评论 -
2016"百度之星" - 初赛(Astar Round2A)
All X Accepts: 1281 Submissions: 7580 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Problem DescriptionF(x, m)F(x,m) 代表一个全是由数字xx组原创 2016-05-21 20:15:55 · 2148 阅读 · 0 评论 -
Beautiful Subarrays
E. Beautiful SubarraysOne day, ZS the Coder wrote down an array of integers a with elementsa1, a2, ..., an.A subarray of the array a is a sequenceal, al + 1, ..., ar for some int原创 2016-06-07 23:52:30 · 1534 阅读 · 0 评论 -
区间交
区间交Time Limit: 8000/4000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 652 Accepted Submission(s): 308Problem Description小A有一个含有n个非负整数的数列与m个区间。每个区间原创 2016-06-01 23:17:23 · 1214 阅读 · 0 评论 -
2016年百度之星C
Problem CTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 284 Accepted Submission(s): 96Problem Description度熊手上有一本神奇的字典,你可以在原创 2016-05-18 13:08:40 · 1460 阅读 · 4 评论 -
1107 斜率小于0的连线数量
1107 斜率小于0的连线数量基准时间限制:1 秒 空间限制:131072 KB 分值: 40 难度:4级算法题 收藏 关注二维平面上N个点之间共有C(n,2)条连线。求这C(n,2)条线中斜率小于0的线的数量。二维平面上的一个点,根据对应的X Y坐标可以表示为(X,Y)。例如:(2,3) (3,4) (1,5) (4,6),其中(1,5)同(2,3)(原创 2016-05-06 00:29:48 · 666 阅读 · 0 评论 -
1405 树的距离之和
1405 树的距离之和基准时间限制:1 秒 空间限制:131072 KB 分值: 40 难度:4级算法题 收藏 取消关注给定一棵无根树,假设它有n个节点,节点编号从1到n, 求任意两点之间的距离(最短路径)之和。Input第一行包含一个正整数n (n <= 100000),表示节点个数。后面(n - 1)行,每行两个整数表示树的边。Ou原创 2016-05-17 07:59:21 · 566 阅读 · 0 评论 -
1366 贫富差距
1366 贫富差距题目来源: TopCoder 基准时间限制:1 秒 空间限制:131072 KB 分值: 40 难度:4级算法题 收藏 关注一个国家有N个公民,标记为0,1,2,...,N-1,每个公民有一个存款额。已知每个公民有一些朋友,同时国家有一条规定朋友间的存款额之差不能大于d。也就是说,a和b是朋友的话,a有x元的存款,b有y元,那么|x-y原创 2016-05-04 23:51:31 · 1210 阅读 · 0 评论 -
退役贴!
@退役贴~~ 难说再见,明年补坑!原创 2015-11-26 22:54:54 · 776 阅读 · 0 评论 -
郑大第九届校赛正式赛(1818: squee_spoon and his Cube VI)
1818: squee_spoon and his Cube VITime Limit: 1 Sec Memory Limit: 128 MBSubmit: 59 Solved: 15SubmitStatusWeb BoardDescription市面上最常见的魔方,是三阶魔方,英文名为Rubik's Cube,以魔方的发明者鲁比克教授的名字命名。另外,二阶魔方叫P原创 2015-12-09 13:26:43 · 706 阅读 · 0 评论 -
Codeforces Round #275 (Div. 2)
A. Counterexampletime limit per test 1 secondmemory limit per test 256 megabytesYour friend has recently learned about coprime numbers. A pair of numbers{a, b} is calle原创 2014-10-25 11:31:19 · 1361 阅读 · 0 评论 -
Codeforces Round #271 (Div. 2)
A. Keyboardtime limit per test 2 secondsmemory limit per test 256 megabytesOur good friend Mole is trying to code a big message. He is typing on an unusual keyboard wit原创 2014-10-07 19:01:18 · 1361 阅读 · 0 评论 -
Bayan 2015 Contest Warm Up
A. Bayan Bustime limit per test 2 secondsmemory limit per test 256 megabytes题目连接:传送门The final round of Bayan Programming Contest will be held in Tehran, and the participants wil原创 2014-10-06 22:05:41 · 1616 阅读 · 0 评论 -
BestCoder Round #11 (Div. 2)
Alice and BobTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 140 Accepted Submission(s): 99Problem DescriptionBob and Alice got原创 2014-09-28 23:09:09 · 687 阅读 · 0 评论 -
ACdream原创群赛(13)のwuyiqi退役专场
H -Salmon And CatTime Limit: 2000/1000MS (Java/Others) Memory Limit: 128000/64000KB (Java/Others)SubmitStatusProblem DescriptionMath is very important, for those who are also in sc原创 2014-09-25 20:00:19 · 788 阅读 · 0 评论 -
大一暑期总结
我的暑期集训总结 ——广东工业大学原创 2014-09-15 00:50:17 · 2489 阅读 · 7 评论 -
神牛........你想过来虐我吗?....
C. George and Numbertime limit per test 1 secondmemory limit per test 256 megabytes题目连接: 传送门George is a cat, so he really likes to play. Most of all he likes to play原创 2014-09-26 20:33:55 · 1043 阅读 · 0 评论 -
ACdream区域赛指导赛之手速赛系列(7)
A -Dragon MazeTime Limit: 2000/1000MS (Java/Others)Memory Limit: 128000/64000KB (Java/Others)Submit Status题目连接: 传送门Problem DescriptionYou are the prince of Dra原创 2014-09-19 17:37:24 · 1525 阅读 · 0 评论 -
Andrew Stankevich's Contest (21)
F - "Money, Money, Money"Time Limit: 2000/1000MS (Java/Others) Memory Limit: 128000/64000KB (Java/Others) Special JudgeSubmitStatusProblem Description The government of Flat原创 2014-10-03 07:25:39 · 1467 阅读 · 1 评论 -
构造题(数论)
J -SumTime Limit: 2000/1000MS (Java/Others) Memory Limit: 128000/64000KB (Java/Others)SubmitStatusProblem DescriptionYou are given an N*N digit matrix and you can get several horiz原创 2014-11-02 17:25:19 · 776 阅读 · 0 评论 -
如何在ubuntu上安装flash_player
一.如何在ubuntu上安装Flash Player 相信很多玩ubuntu的都会遇到这样一个问题,当你在网上看视频时,屏幕总会弹出你没用安装 Flash Player,然后就有一个选项叫你下载Flash Player.遇到这种情况时,我们先下载下来,选择linux tar.gz版本,下载,然后解压到当前目录. 接着点开解压后的文件,你会看到libflashpla原创 2015-01-15 20:31:41 · 1394 阅读 · 0 评论 -
郑大第九届校赛正式赛(1819: 加加加!(油))
1819: 加加加!(油)Time Limit: 1 Sec Memory Limit: 128 MBSubmit: 72 Solved: 42SubmitStatusWeb BoardDescription实验室的小D同学又开始玩游戏了,这次他的游戏貌似很高级的样子。首先他在一张纸上写下了一个数n,然后他在两个无差别的球上写上两个数分别是a和b,他把两个球放在一个原创 2015-12-09 13:40:09 · 893 阅读 · 0 评论 -
郑州大学第九届程序设计竞赛热身赛题解
1808: 小d的翻转游戏Time Limit: 1 Sec Memory Limit: 128 MBSubmit: 73 Solved: 15SubmitStatusWeb BoardDescription小d同学最近在玩翻转棋的游戏,这个棋类游戏的棋子是黑白两面的,他玩这个游戏已经玩了很久了,他觉得没有什么新意了,所以他打算换一种玩法。首先他把这些黑色和白色的棋原创 2015-12-09 12:45:51 · 1313 阅读 · 0 评论 -
郑大第九届校赛正式赛(1812: sort)
1812: sortTime Limit: 1 Sec Memory Limit: 128 MBSubmit: 155 Solved: 28SubmitStatusWeb BoardDescription想必大家对排序已经很熟悉了,但是spy好像对排序不太熟悉,有一天,他看到这样一个关于排序的题目:对于 k 个用空格分隔开的整数,依次为 n1, n2 … nk。原创 2015-12-09 12:58:37 · 582 阅读 · 0 评论 -
Testing Round #12
A. DivisibilityFind the number of k-divisible numbers on the segment[a, b]. In other words you need to find the number of such integer valuesx that a ≤ x ≤ b andx is divisible by k.原创 2015-11-12 13:38:28 · 629 阅读 · 0 评论 -
Non-negative Partial Sums(单调队列,好题)
Non-negative Partial SumsTime Limit: 6000/3000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 2252 Accepted Submission(s): 773Problem DescriptionYou原创 2015-10-02 16:29:30 · 998 阅读 · 0 评论