2018年1月26日

Ultra-QuickSort (POJ 2299)树状数组+离散化

摘要: 题目链接 Description In this problem, you have to analyze a particular sorting algorithm. The algorithm processes a sequence of n distinct integers by swa 阅读全文

posted @ 2018-01-26 17:40 欲儿很轻狂 阅读(134) 评论(0) 推荐(0) 编辑

Color the ball(HDU1556)树状数组

摘要: 每次对区间内气球进行一次染色,求n次操作后后所有气球染色次数。 树状数组,上下区间更新都可以,差别不大。 1.对于[x,y]区间,对第x-1位减1,第y位加1,之后向上统计 #include<bits/stdc++.h> using namespace std; const int maxn=100 阅读全文

posted @ 2018-01-26 10:24 欲儿很轻狂 阅读(105) 评论(0) 推荐(0) 编辑

2018年1月6日

Codeforces Round #456 (Div. 2) B. New Year's Eve

摘要: B. New Year's Eve time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Since Grisha behaved we 阅读全文

posted @ 2018-01-06 17:07 欲儿很轻狂 阅读(203) 评论(0) 推荐(0) 编辑

Good Bye 2017 G. New Year and Original Order

摘要: G. New Year and Original Order time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Let S(n) 阅读全文

posted @ 2018-01-06 16:55 欲儿很轻狂 阅读(536) 评论(0) 推荐(0) 编辑

2018年1月1日

Good Bye 2017 C. New Year and Curling

摘要: Carol is currently curling. She has n disks each with radius r on the 2D plane. Initially she has all these disks above the line y = 10100. She then w 阅读全文

posted @ 2018-01-01 16:21 欲儿很轻狂 阅读(146) 评论(0) 推荐(0) 编辑

2017年12月30日

Good Bye 2017(送命场)

摘要: 9815人数场,9500+围观神仙打架...断断续续打Codeforces也快有一年啦,第一次打Good Bye场,满怀前排膜tourist的心愿参加了这场送命场,虽然没看到tourist。不过还是得见Petr粑粑、杜教 AK。哇,不是很懂你们div1.... 啊,不过还是很休闲,暴力写了份897行 阅读全文

posted @ 2017-12-30 02:22 欲儿很轻狂 阅读(226) 评论(0) 推荐(0) 编辑

2017年12月21日

求逆元的方法

摘要: 乘法逆元的定义 若ax≡1%p, 则称a关于模p的乘法逆元为x。 当a与p互质时,a关于模p的乘法逆元有解。如果不互质,则无解。如果p为质数,则从1到p-1的任意数都与p互质,即在1到p-1之间都恰好有一个关于模p的乘法逆元。且1到p-1中的所有数的逆元对应1到p-1中的所有数,既是单射也是满射。 阅读全文

posted @ 2017-12-21 20:24 欲儿很轻狂 阅读(239) 评论(0) 推荐(0) 编辑

2017年12月17日

Educational Codeforces Round 34 (Rated for Div. 2) D - Almost Difference(高精度)

摘要: D. Almost Difference Let's denote a function You are given an array a consisting of n integers. You have to calculate the sum of d(ai, aj) over all pa 阅读全文

posted @ 2017-12-17 21:20 欲儿很轻狂 阅读(192) 评论(0) 推荐(0) 编辑

Codeforces Round #452 (Div. 2) C. Dividing the numbers(水)

摘要: C. Dividing the numbers Petya has n integers: 1, 2, 3, ..., n. He wants to split these integers in two non-empty groups in such a way that the absolut 阅读全文

posted @ 2017-12-17 20:55 欲儿很轻狂 阅读(213) 评论(0) 推荐(0) 编辑

2017年12月13日

Educational Codeforces Round 34 (Rated for Div. 2) C. Boxes Packing

摘要: C. Boxes Packing time limit per test 1 second time limit per test 1 second memory limit per test 256 megabytes input standard input output standard ou 阅读全文

posted @ 2017-12-13 01:40 欲儿很轻狂 阅读(261) 评论(0) 推荐(0) 编辑

导航