- 博客(23)
- 收藏
- 关注
原创 数论--容斥
hdu2204最为基本得容斥入门,思路是将n开根号,开的次方得是素数,因为如果是合数就会有重复计算,让后减去素数的重叠部分即可。#include <bits/stdc++.h>#define maxn 40using namespace std;typedef long long ll;ll isprime[70]={2,3,5,7,11,13,17,19,23,29,31...
2019-05-29 23:19:30
140
原创 数论-模拟退火
题目大佬说这题可以很好的入门模拟退火虽然模拟退火不是这题的最佳解本题求一个平衡点,我们要找一个点使得∑ni=1di∗wi最小(di为i点到该点的距离)。大佬是这么说的。。。#include<bits/stdc++.h>#define inf 0x3f3f3f3f#define RG register#define R RG long double#define RD ...
2019-05-16 21:03:25
264
原创 基础
int poww(int a, int b) { int ans = 1, base = a; while (b != 0) { if (b & 1 != 0) ans *= base; base *= base; b >>= 1; } return ans;...
2019-05-13 21:37:43
117
原创 hdu6463超级无敌简单题
超级无敌简单题超级无敌简单题Description通常来说,题面短的题目一般都比较难,所以我要把题面写得很长很长。通常来说,题面短的题目一般都比较难,所以我要把题面写得很长很长。通常来说,题面短的题目一般都比较难,所以我要把题面写得很长很长。鸽子数字由以下过程定义:从任何正整数开始,将数字替换为其各个数位的平方和,并重复该过程,直到该数字等于1。如果不能,则这个数字不是...
2019-05-12 14:38:27
268
原创 hdu4596
Yet another end of the worldhttp://acm.hdu.edu.cn/showproblem.php?pid=4596DescriptionIn the year 3013, it has been 1000 years since the previous predicted rapture. However, the Maya will no...
2019-05-10 14:30:52
147
原创 莫比乌斯反演模板hdu1695
GCDhttp://acm.hdu.edu.cn/showproblem.php?pid=1695DescriptionGiven 5 integers: a, b, c, d, k, you're to find x in a...b, y in c...d that GCD(x, y) = k. GCD(x, y) means the greatest common di...
2019-05-03 15:00:39
159
原创 poj3450
Corporate Identityhttp://poj.org/problem?id=3450DescriptionBeside other services, ACM helps companies to clearly state their “corporate identity”, which includes company logo but also other...
2019-04-14 14:49:56
198
原创 hdu2089
不要62不要62http://acm.hdu.edu.cn/showproblem.php?pid=2089Description杭州人称那些傻乎乎粘嗒嗒的人为62(音:laoer)。杭州交通管理局经常会扩充一些的士车牌照,新近出来一个好消息,以后上牌照,不再含有不吉利的数字了,这样一来,就可以消除个别的士司机和乘客的心理障碍,更安全地服务大众。不吉利的数字为所有含有4或...
2019-03-20 23:32:50
70
原创 hdu2571
命运http://acm.hdu.edu.cn/showproblem.php?pid=2571Description穿过幽谷意味着离大魔王lemon已经无限接近了!可谁能想到,yifenfei在斩杀了一些虾兵蟹将后,却再次面临命运大迷宫的考验,这是魔王lemon设下的又一个机关。要知道,不论何人,若在迷宫中被困1小时以上,则必死无疑!可怜的yifenfei为了去救MM,...
2019-03-19 23:53:15
71
原创 hdu1074
Doing Homeworkhttp://acm.hdu.edu.cn/showproblem.php?pid=1074DescriptionIgnatius has just come back school from the 30th ACM/ICPC. Now he has a lot of homework to do. Every teacher gives him...
2019-03-19 00:42:27
73
原创 HDU1698
Just a HookJust a Hookhttp://acm.hdu.edu.cn/showproblem.php?pid=1698DescriptionIn the game of DotA, Pudge’s meat hook is actually the most horrible thing for most of the heroes. The hook is...
2019-03-15 15:00:26
166
原创 HDU1166
敌兵布阵敌兵布阵http://acm.hdu.edu.cn/showproblem.php?pid=1166DescriptionC国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Derek和他手下Tidy又开始忙乎了。A国在海岸线沿直线布置了N个工兵营地,Derek和Tidy的任务就是要监视这些工兵营地的活动情况。由于采取了某种先进的监测手段,所以每个工兵营地的人数...
2019-03-14 16:01:26
83
原创 poj2777
Count Colorhttp://poj.org/problem?id=2777DescriptionChosen Problem Solving and Program design as an optional course, you are required to solve all kinds of problems. Here, we get a new prob...
2019-03-12 21:30:50
507
原创 poj2828
POJ2828Buy Ticketshttp://poj.org/problem?id=2828DescriptionRailway tickets were difficult to buy around the Lunar New Year in China, so we must get up early and join a long queue…The Lunar...
2019-03-11 21:27:43
179
原创 hdu2527
Safe Or Unsafehttp://acm.hdu.edu.cn/showproblem.php?pid=2527DescriptionJavac++ 一天在看计算机的书籍的时候,看到了一个有趣的东西!每一串字符都可以被编码成一些数字来储存信息,但是不同的编码方式得到的储存空间是不一样的!并且当储存空间大于一定的值的时候是不安全的!所以Javac++ 就想是否有一种方式...
2019-03-09 15:42:21
319
原创 CodeForces 1131B Draw!
F - Draw! https://codeforces.com/problemset/problem/1131/BDescriptionYou still have partial information about the score during the historic football match. You are given a set of pairs (ai,...
2019-03-05 21:41:08
261
原创 CodeForces 1081B Farewell Party
https://codeforces.com/contest/1081/problem/BB - Farewell Party https://codeforces.com/contest/1081/problem/BDescriptionChouti and his classmates are going to the university soon. To say go...
2019-03-04 17:24:54
185
原创 POJ3026
http://poj.org/problem?id=3026DescriptionThe Borg is an immensely powerful race of enhanced humanoids from the delta quadrant of the galaxy. The Borg collective is the term used to describe...
2019-02-22 00:54:40
210
原创 Wormholes
Wormholeshttps://vjudge.net/contest/281565#problem/DDescriptionIn the year 2163, wormholes were discovered. A wormhole is a subspace tunnel through space and timeconnecting two star system...
2019-02-17 17:02:51
189
原创 HDU1317
http://acm.hdu.edu.cn/showproblem.php?pid=1317XYZZYhttp://acm.hdu.edu.cn/showproblem.php?pid=1317Problem DescriptionIt has recently been discovered how to run open-source software on the Y-...
2019-02-17 16:07:57
218
原创 hdu3038
http://acm.hdu.edu.cn/showproblem.php?pid=3038How Many Answers Are Wronghttp://acm.hdu.edu.cn/showproblem.php?pid=3038TT and FF are ... friends. Uh... very very good friends -________-bFF ...
2019-02-12 14:16:22
585
原创 HDU - 2181
https://vjudge.net/problem/28243/originG-长https://vjudge.net/problem/28243/origin一个规则的实心十二面体,它的 20个顶点标出世界著名的20个城市,你从一个城市出发经过每个城市刚好一次后回到出发的城市。 Input前20行的第i行有3个数,表示与第i个城市相邻的3个城市.第20行以后每行有1个...
2019-01-20 17:15:01
192
原创 CodeForces 1082B
https://vjudge.net/problem/2065317/originH-世https://vjudge.net/problem/2065317/originVova has won n trophies in different competitions. Each trophy is either golden or silver. The trophies ...
2019-01-20 13:19:53
114
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人