自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(61)
  • 收藏
  • 关注

原创 【推荐系统】UserCF基于用户的协同过滤

#movielens数据集,代码只考虑该用户是否对某些物品感兴趣,不管评分,有分数就认为感兴趣import pandas as pdfrom collections import defaultdictimport numpy as np# 读取文件ratings = pd.read_csv('./movielens/ratings.csv') trainset=ratings.s...

2020-03-04 16:55:42 269 1

原创 【并查集】POJ_1456_Supermarket

SupermarketTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 13518 Accepted: 6104DescriptionA supermarket has a set Prod of products on sale. It earns a p

2017-08-19 10:39:42 241

原创 【并查集】POJ_1984_Navigation Nightmare

Navigation NightmareTime Limit: 2000MS Memory Limit: 30000KTotal Submissions: 7036 Accepted: 2521Case Time Limit: 1000MSDescriptionFarmer John's pastoral ne

2017-08-19 09:50:01 312

原创 【离散化+并查集】POJ_1733_Parity game

Parity gameTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 9578 Accepted: 3713DescriptionNow and then you play the following game with your friend. Your

2017-08-19 09:03:50 230

原创 【并查集】POJ_2492_A Bug's Life

A Bug's LifeTime Limit: 10000MS Memory Limit: 65536KTotal Submissions: 39001 Accepted: 12669DescriptionBackground Professor Hopper is researching the sexual beh

2017-08-18 20:44:12 197

原创 【并查集】HDU_3038_How Many Answers Are Wrong

How Many Answers Are WrongTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 9690    Accepted Submission(s): 3525Problem Description

2017-08-18 19:33:46 228

原创 【DP】HDU_2859_Phalanx

PhalanxTime Limit: 10000/5000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1998    Accepted Submission(s): 991Problem DescriptionToday is army day,

2017-08-18 09:28:22 198

原创 【区间DP】POJ_3186_Treats for the Cows

Treats for the CowsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 6369 Accepted: 3341DescriptionFJ has purchased N (1 The treats are interesting fo

2017-08-18 08:26:37 220

原创 【DP】POJ_1661_Help Jimmy

Help JimmyTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 12214 Accepted: 4030Description"Help Jimmy" 是在下图所示的场景上完成的游戏。 场景中包括多个长度和高度各不相同的平台。地面是最低的平

2017-08-17 21:52:55 223

原创 【DP】POJ_3616_Milking Time

Milking TimeTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 10460 Accepted: 4388DescriptionBessie is such a hard-working cow. In fact, she is so focused

2017-08-17 19:27:41 171

原创 【折半枚举】HDU_5616_Jam's balance

Jam's balanceTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1830    Accepted Submission(s): 767Problem DescriptionJim has a bal

2017-08-16 15:43:33 233

原创 【欧拉定理】BZOJ_3884_上帝与集合的正确用法

根据一些书上的记载,上帝的一次失败的创世经历是这样的:第一天,  上帝创造了一个世界的基本元素,称做“元”。第二天,  上帝创造了一个新的元素,称作“α”。“α”被定义为“元”构成的集合。容易发现,一共有两种不同的“α”。第三天,  上帝又创造了一个新的元素,称作“β”。“β”被定义为“α”构成的集合。容易发现,一共有四种不同的“β”。第四天,  上帝创造了新的元素“γ”,“γ”被

2017-08-12 00:22:11 215

原创 【拓欧+逆元】

个人整理的关于拓欧逆元的不会markdown只会乱七八糟复制粘贴一般人看不懂系列 欧几里德: gcd(a, b) = gcd(b , a%b) 扩展欧几里德算法是用来在已知a, b求解一组x,y,使它们满足贝祖等式: ax+by = gcd(a, b) =c(解一定存在,根据数论中的相关定理)之前一直不太懂为什么gcd(a,b)|c是有解条件,大佬口胡了一句就懂了。所以我们

2017-08-11 20:58:24 342

原创 【整数划分+DP】HDU_1028_D - Ignatius and the Princess III

Ignatius and the Princess IIITime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 22366    Accepted Submission(s): 15616Problem Descripti

2017-08-10 22:57:01 225

原创 【第二类斯特林数】HDU_2643_Rank

RankTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 604    Accepted Submission(s): 307Problem DescriptionRecently in Teddy's hom

2017-08-10 22:39:45 438

原创 【第一类斯特林数】HDU_4372_ Count the Buildings

Count the BuildingsTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 2051    Accepted Submission(s): 676Problem DescriptionThere a

2017-08-10 22:15:09 230

原创 【第一类斯特林数】HDU_3625_Examining the Rooms

Examining the RoomsTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1851    Accepted Submission(s): 1130Problem DescriptionA murd

2017-08-10 22:14:05 292

原创 【矩阵快速幂】HDU_2157_How many ways??

How many ways??Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3937    Accepted Submission(s): 1553Problem Description春天到了, HDU校

2017-08-10 00:02:40 224

原创 【矩阵快速幂】LightOJ_1132_Summing up Powers

Given N and K, you have to find(1K + 2K + 3K + ... + NK) % 232InputInput starts with an integer T (≤ 200), denoting the number of test cases.Each case contains two integers N (1 ≤ N ≤ 1015) an

2017-08-09 23:47:31 251

原创 【矩阵快速幂】HDU_4565_So Easy!

So Easy!Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 5051    Accepted Submission(s): 1660Problem Description  A sequence Sn i

2017-08-09 21:58:17 724

原创 【矩阵快速幂】LightOJ_1070_Algebraic Problem

Given the value of a+b and ab you will have to find the value of an+bn. a and b not necessarily have to be real numbers.InputInput starts with an integer T (≤ 10000), denoting the number of test c

2017-08-09 18:58:24 238

原创 【矩阵快速幂】HDU_1005_Number Sequence

Number SequenceTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 177435    Accepted Submission(s): 44019Problem DescriptionA numbe

2017-08-09 18:55:13 194

原创 【欧拉降幂公式+快速幂】HDU_4704_Sum

SumTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 3440    Accepted Submission(s): 1408Problem Description Sample

2017-08-08 19:35:06 440

原创 【博弈+SG函数+打表找规律】HDU_5795_A Simple Nim

Two players take turns picking candies from n heaps,the player who picks the last one will win the game.On each turn they can pick any number of candies which come from the same heap(picking no candy

2017-08-05 23:26:51 277

原创 【博弈】取石子游戏

两堆石子,数量任意,可以不同。游戏开始由两个人轮流取石子。游戏规定,每次有两种不同的取法,一是可以在任意的一堆中取走任意多的石子;二是可以在两堆中同时取走相同数量的石子。最后把石子全部取完者为胜者。现在给出初始的两堆石子的数目,如果轮到你先取,假设双方都采取最好的策略,问最后你是胜者还是败者。Input输入包含若干行,表示若干种石子的初始情况,其中每一行包含两个非负整数a和b,表示两堆石子

2017-08-05 23:22:52 256

原创 【博弈+找规律】HDU_5963_朋友

加——阿里云“智慧航空AI大赛”(报名中...) 朋友Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 488    Accepted Submission(s): 293Problem

2017-08-05 23:17:29 232

原创 【博弈+找规律】HDU_4642_Fliping game

Fliping gameTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2029    Accepted Submission(s): 1363Problem DescriptionAlice and Bob

2017-08-05 23:07:05 240

原创 【BFS+状压】HDU_5025_ Saving Tang Monk

Saving Tang MonkTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 2732    Accepted Submission(s): 972Problem Description《Journey t

2017-08-04 18:59:36 254

原创 【BFS+状压】HDU_4771_Stealing Harry Potter's Precious

Stealing Harry Potter's PreciousTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4050    Accepted Submission(s): 1749Problem Descript

2017-08-04 18:57:41 246

原创 【DFS迭代加深搜索+剪枝】POJ_1011_Sticks

SticksTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 146700 Accepted: 34745DescriptionGeorge took sticks of the same length and cut them randomly until

2017-08-03 23:50:49 197

原创 【BFS】HDU_1180_诡异的楼梯

/* 如果要走的方向是竖直方向,楼梯是水平方向的时候是不能走的, 刚开始以为只要走到楼梯就顺着楼梯的方向走。。 如果走的方向跟楼梯方向不一样,可以等一步,到楼梯与走的方向相同,步数+2 一开始没用优先队列,直接找到一个点就输出, 一开始找到的点不一定路径就最短。。 分为4个方向讨论。*/#include #include #include #include #include

2017-07-29 22:06:57 236

原创 【dfs+奇偶剪枝】HDU_1010_Tempter of the Bone

Tempter of the BoneTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 126847    Accepted Submission(s): 34200Problem DescriptionThe

2017-07-29 19:46:20 185

原创 【单调队列】HDU_3706_Second My Problem First

Second My Problem FirstTime Limit: 12000/4000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1931    Accepted Submission(s): 734Problem DescriptionGive y

2017-07-27 21:41:59 295

原创 【单调队列】POJ_2823 Sliding Window

Sliding WindowTime Limit: 12000MS Memory Limit: 65536KTotal Submissions: 61189 Accepted: 17511Case Time Limit: 5000MSDescriptionAn array of size n ≤ 106 is

2017-07-26 21:29:06 206

原创 【博弈】HackerRank _ stone_division

Consider the following game:There are two players, First and Second, sitting in front of a pile of  stones. First always plays first.There is a set, , of  distinct integers defined as .The p

2017-06-20 17:21:15 314

原创 【强连通缩点+记忆化搜索求最长路】ZOJ_3795_Grouping

ZOJ Problem Set - 3795GroupingTime Limit: 2 Seconds      Memory Limit: 65536 KBSuppose there are N people in ZJU, whose ages are unknown. We have some messages about them. The i-th message

2017-06-20 16:11:35 271

原创 【公式+矩阵快速幂】HDU_3117 Fibonacci Numbers

Fibonacci NumbersTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2562    Accepted Submission(s): 1069Problem DescriptionThe Fibonacc

2017-06-15 18:10:53 424

原创 【递归输出图形】POJ_1941

The Sierpinski FractalTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 4720 Accepted: 1953DescriptionConsider a regular triangular area, divide it into f

2017-06-11 20:29:45 1052

原创 【最小生成树】UVA_12507

/* 这题也很难过 n个点,m条边,选择任意几条边使得总花费<=k,而且和1相连的点的权值和最大 枚举组成最小生成树的点 总共2^16种选择,对每种选择求最小生成树,如果最小生成树的值<=k,选择点权值和最大的*/#include #define INF 0x3f3f3f3fusing namespace std;int Map[25][25],f[25]

2017-06-10 20:22:29 229

原创 [最短路]D. 百度地图导航

百度地图上有 nn 个城市,城市编号依次为 11 到 nn。地图中有若干个城市群,编号依次为 11 到 mm。每个城市群包含一个或多个城市;每个城市可能属于多个城市群,也可能不属于任何城市群。地图中有两类道路。第一类道路是 城市之间的快速路,两个城市 u,vu,v 之间增加一条距离为 cc 的边;第二类道路是城市群之间的高速路,连接两个城市群 a,ba,b,通过这条高速路,城市群 aa 里的每

2017-06-10 20:15:46 490

空空如也

空空如也

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

TA关注的人

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