- 博客(109)
- 收藏
- 关注
原创 Python yield关键字 【QA With ChatGPT】
下一次迭代时,生成器函数会从上一次暂停的地方继续执行,继续生成值,直到遇到下一个 yield 关键字或者函数结束。下一次迭代时,生成器函数会从上一次暂停的地方继续执行,继续生成值,直到遇到下一个 yield 关键字或者函数结束。() 方法再次被调用时,Python 会恢复生成器函数的状态,并从上一次暂停的地方继续执行,直到遇到下一个 yield 关键字或者函数结束。() 方法被调用时,Python 会在生成器函数的代码中执行到下一个 yield 关键字处,并将生成的值返回给调用者。
2023-03-18 22:26:27 490 1
原创 关于MyBatis中Mapper的XML中何时需要显式定义TypeHandler
关于MyBatis中Mapper的XML中何时需要显式定义TypeHandler标签(空格分隔): mybatis题目中的显式定义TypeHandler,也包括定义parameterType、parameterMap等,这些都是MyBatis用来找TypeHandler的依据。我们知道,MyBatis可以一定程度地简化Mapper的xml配置文件的编写,但到底简化到什么程度呢?最近在写项...
2018-09-21 01:19:36 2820
原创 使用 Java NIO 实现 Simple Redis 服务端 客户端
最近在学习NIO,想找个demo来练练手,然后发现用java nio来简单实现redis应该挺有趣的。Java NIO 概览首先,java nio有3个重要的类: * ByteBuffer: 用于读写数据,实际上是byte数组的一个封装。它的使用方式还是比较有趣的,需要注意的一点是在写模式转换为读模式时需要flip()。 * Channel: 用于维护服务端与客户端的通信通道。 ...
2018-07-18 09:11:48 942
原创 uva_12298 Super Jokwe II(FFT)
题目链接题目要求牌的组合数,可以转化为多项式乘法。 设某种花色对应的多项式为 则的指数则可以表示扑克牌的点数,系数则可以赋值为0或1,来表示该点数是否存在。 四种花色,则一共有4条多项式,将这些多项式乘起来,结果的的系数即为点数之和为r的方法数。 那么现在的问题是如何进行多项式的乘法,直接暴力的复杂度会超时,需要用FFT加速,时间复杂度为。 FFT的原理和实现的话推荐看这位小哥的视频,
2017-06-11 23:14:45 507
原创 BZOJ_2038 小Z的袜子(莫队算法)
BZOJ【2038】—— [2009国家集训队]小Z的袜子(hose)Time Limit: 20 SecMemory Limit: 259 MBDescription作为一个生活散漫的人,小Z每天早上都要耗费很久从一堆五颜六色的袜子中找出一双来穿。终于有一天,小Z再也无法忍受这恼人的找袜子过程,于是他决定听天由命…… 具体来说,小Z
2017-03-25 01:41:13 323
原创 poj_2480 Longge's problem(素因子分解+积性函数+欧拉phi函数)
Longge's problemTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 8297 Accepted: 2765DescriptionLongge is good at mathematics and he likes to think about ha
2017-03-16 21:51:37 380
原创 codeforces 456B. Fedya and Maths(大数取模/大数的幂)
B. Fedya and Mathstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputFedya studies in a gymnasium. Fedya's mat
2017-03-15 09:57:43 520
原创 codeforces 603C. Lieges of Legendre(博弈+SG函数)
C. Lieges of Legendretime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputKevin and Nicky Sun have invented a n
2017-03-13 20:16:35 738
原创 codeforces 777E. Hanoi Factory (LIS+dp+树状数组/线段树维护区间最大值及单点更新)
E. Hanoi Factorytime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputOf course you have heard the famous task ab
2017-03-09 00:48:35 419
原创 codeforces 782D Innokenty and a Football League(2-SAT)
D. Innokenty and a Football Leaguetime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputInnokenty is a president
2017-03-06 22:41:10 1035
原创 poj_2454 Jersey Politics(贪心+随机)
Jersey PoliticsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 5596 Accepted: 1416 Special JudgeDescriptionIn the newest census of Jersey Cows and Hol
2017-01-10 17:49:46 501
原创 poj_1487 Single-Player Games(高斯消元+自由元)
Single-Player GamesTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 1479 Accepted: 407DescriptionPlaying games is the most fun if other people take part. B
2016-12-23 00:22:04 1139
原创 poj_1166 The Clocks(高斯消元)
The ClocksTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 16797 Accepted: 6939Description|-------| |-------| |-------|| | | |
2016-12-19 22:44:56 809
原创 poj_2187 Beauty Contest(凸包+旋转卡壳)
Beauty ContestTime Limit: 3000MS Memory Limit: 65536KTotal Submissions: 35711 Accepted: 11066DescriptionBessie, Farmer John's prize cow, has just won first place in
2016-11-23 19:19:09 347
原创 poj_1416 Shredding Company(dfs)
Shredding CompanyTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 5684 Accepted: 3190DescriptionYou have just been put in charge of developing a new shre
2016-11-16 22:13:28 260
原创 poj_1426 Find The Multiple(bfs + 同余模定理)
Find The MultipleTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 27988 Accepted: 11621 Special JudgeDescriptionGiven a positive integer n, write a p
2016-11-08 12:14:39 307
原创 poj_3278 Catch That Cow(bfs)
Catch That CowTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 79009 Accepted: 24912DescriptionFarmer John has been informed of the location of a fugitiv
2016-11-07 13:40:19 270
原创 poj_1321 棋盘问题(dfs)
棋盘问题Time Limit: 1000MS Memory Limit: 10000KTotal Submissions: 37781 Accepted: 18537Description在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求
2016-11-06 17:44:54 259
原创 poj_2513 Colored Sticks(字典树+并查集+欧拉通路)
Colored SticksTime Limit: 5000MS Memory Limit: 128000KTotal Submissions: 36048 Accepted: 9431DescriptionYou are given a bunch of wooden sticks. Each endpoint of e
2016-11-04 13:42:29 336
原创 poj_3253 Fence Repair(优先队列 / 堆)
Fence RepairTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 41793 Accepted: 13611DescriptionFarmer John wants to repair a small length of the fence arou
2016-11-03 14:26:02 252
原创 poj_2503 Babelfish(ELF哈希)
BabelfishTime Limit: 3000MS Memory Limit: 65536KTotal Submissions: 41750 Accepted: 17700DescriptionYou have just moved from Waterloo to a big city. The people her
2016-11-02 21:28:55 291
原创 poj_2002 Squares(哈希)
SquaresTime Limit: 3500MS Memory Limit: 65536KTotal Submissions: 19231 Accepted: 7429DescriptionA square is a 4-sided polygon whose sides have equal length and ad
2016-11-02 18:56:42 267
原创 poj_1840 Eqs(二分查找 / 哈希)
EqsTime Limit: 5000MS Memory Limit: 65536KTotal Submissions: 15935 Accepted: 7814DescriptionConsider equations having the following form: a1x13+ a2x23+ a3x33+ a
2016-11-01 11:48:29 277
原创 poj_2151 Check the difficulty of problems(概率dp)
Check the difficulty of problemsTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 7053 Accepted: 3051DescriptionOrganizing a programming contest is not an
2016-10-31 23:13:44 246
原创 poj_3274 Gold Balanced Lineup(数字哈希)
Gold Balanced LineupTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 15074 Accepted: 4361DescriptionFarmer John's N cows (1 ≤ N ≤ 100,000) share many sim
2016-10-30 18:11:36 364
原创 poj_3349 Snowflake Snow Snowflakes(数字哈希)
Snowflake Snow SnowflakesTime Limit: 4000MS Memory Limit: 65536KTotal Submissions: 39366 Accepted: 10311DescriptionYou may have heard that no two snowflakes are a
2016-10-30 11:58:07 279
原创 poj_2299 Ultra-QuickSort(归并排序/树状数组 求逆序对)
Ultra-QuickSortTime Limit: 7000MS Memory Limit: 65536KTotal Submissions: 57323 Accepted: 21183DescriptionIn this problem, you have to analyze a particular sorting
2016-10-29 14:54:17 268
原创 poj_3436 ACM Computer Factory(Dinic + 拆点)
ACM Computer FactoryTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 7212 Accepted: 2566 Special JudgeDescriptionAs you know, all the computers used
2016-10-27 19:54:01 304
原创 poj_1459 Power Network(多源多汇最大网络流)(EK / dinic / ISAP)
Power NetworkTime Limit: 2000MS Memory Limit: 32768KTotal Submissions: 27462 Accepted: 14275DescriptionA power network consists of nodes (power stations, consumer
2016-10-25 14:32:08 967
原创 hdu_2255 奔小康赚大钱(KM算法)
奔小康赚大钱Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 7688 Accepted Submission(s): 3423Problem Description传说在遥远的地方有一个非常富裕的村落,有一天,村长决定进行
2016-10-24 10:41:02 257
原创 poj_3020 Antenna Placement(二分图最小路径覆盖)
Antenna PlacementTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 9027 Accepted: 4468DescriptionThe Global Aerial Research Centre has been allotted the t
2016-10-23 21:35:04 329
原创 poj_3041 Asteroids(匈牙利算法+最小点覆盖)
AsteroidsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 20834 Accepted: 11322DescriptionBessie wants to navigate her spaceship through a dangerous aste
2016-10-23 14:16:19 335
原创 poj_1094 Sorting It All Out(拓扑排序 + floyd)
Sorting It All OutTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 33486 Accepted: 11678DescriptionAn ascending sorted sequence of distinct values is one
2016-10-22 14:49:34 307
原创 poj_3026 Borg Maze(prim + BFS)
Borg MazeTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 13296 Accepted: 4338DescriptionThe Borg is an immensely powerful race of enhanced humanoids fro
2016-10-21 21:04:36 287
原创 poj_1258 Agri-Net(prim)
Agri-NetTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 53526 Accepted: 22230DescriptionFarmer John has been elected mayor of his town! One of his campa
2016-10-21 14:43:24 240
原创 poj_2485 Highways(kruskal)
HighwaysTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 29098 Accepted: 13276DescriptionThe island nation of Flatopia is perfectly flat. Unfortunately,
2016-10-21 13:53:03 189
原创 poj_1789 Truck History(prim)
Truck HistoryTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 25746 Accepted: 10023DescriptionAdvanced Cargo Movement, Ltd. uses trucks of different type
2016-10-21 00:05:17 190
原创 poj_2240 Arbitrage(Bellman_ford + map)
ArbitrageTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 21409 Accepted: 9122DescriptionArbitrage is the use of discrepancies in currency exchange rates
2016-10-19 20:25:36 211
原创 poj_1125 Stockbroker Grapevine(floyd)
Stockbroker GrapevineTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 34651 Accepted: 19210DescriptionStockbrokers are known to overreact to rumours. You
2016-10-19 18:19:27 199
原创 poj_2253 Frogger(floyd + %f)
FroggerTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 38675 Accepted: 12454DescriptionFreddy Frog is sitting on a stone in the middle of a lake. Sudden
2016-10-18 13:10:55 273
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人