![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数学or数论
心悦灵溪
这个作者很懒,什么都没留下…
展开
-
HDU 5584 LCM Walk 【数学+思维+逆推】
HDU 5584LCM Walk Problem DescriptionA frog has just learned some number theory, and can’t wait to show his ability to his girlfriend.Now the frog is sitting on a grid map of infinite rows and ...原创 2020-03-15 21:45:16 · 270 阅读 · 0 评论 -
Codeforces 1244 A,B,C
A.Pens and Pencils传送门签到题#include<iostream>#include<algorithm>#include<cstring>#include<cstdio>#include<cmath>#define ll long long#define inf 0x3f3f3f3fusing nam...原创 2019-10-14 16:38:43 · 762 阅读 · 6 评论 -
2019 ICPC 南京网络赛 B题 super_log【扩展欧拉定理+降幂】
传送门:super_log 扩展欧拉定理:将其合并:图片来源:链接递归依次降幂即可,每次降幂都得判断条件。推荐博客:类似的数塔问题AC代码:#include<iostream>#include<algorithm>#include<cstring>#include<cstdio>#include<cm...原创 2019-09-03 11:20:59 · 224 阅读 · 0 评论 -
Gym - 102021B Battle Royale 【数学】
传送门:Gym - 102021BBattle Royale games are the current trend in video games and Gamers Concealed PunchingCircles (GCPC) is the most popular game of them all. The game takes place in an area that, ...原创 2019-08-16 11:52:43 · 415 阅读 · 0 评论 -
HDU 6441 Find Integer 【费马大定理】
传送门:HDU 6441Find IntegerTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Problem Descriptionpeople in USSS love math very much, and there is a famous math pro...原创 2019-08-20 14:55:13 · 135 阅读 · 0 评论 -
Codeforces 1201C Maximum Median
传送门:Codeforces 1201C Maximum MedianYou are given an array a of n integers, where n is odd. You can make the following operation with it:Choose one of the elements of the array (for example ai) ...原创 2019-08-07 16:21:32 · 461 阅读 · 0 评论 -
HDU 5976 Detachment 【数论+贪心+逆元+前缀和、积】
传送门:HDU 5976DetachmentTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Problem DescriptionIn a highly developed alien society, the habitats are almost infinit...原创 2019-07-28 20:48:12 · 361 阅读 · 0 评论 -
数论:正整数分解使得乘积最大
引入问题:要求将一个正整数n分成几个自然数的和,使这些自然数的乘积最大。输出这个最大值。分两种要求:(1)这些自然数可以相同;(2)这些自然数互不相同;(同一个数n,1的结果应该比2大)。分析:(只分析n>=4的情况,因为n<4最大值都是本身)1.这些自然数可以相同我们先列几个数找找规律:4=2+2、5=3+2、6=3+3、7=3+2+2、8=2+2+2+2...原创 2019-07-28 20:32:06 · 4441 阅读 · 0 评论 -
HDU 2773 White Water Rafting 【数学+点到线段的最短距离】
传送门:HDU2773White Water RaftingTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Problem DescriptionYou have been hired by a big theme park to design a new attr...原创 2019-07-27 14:49:35 · 211 阅读 · 1 评论 -
HDU 2769 Disgruntled Judge 【扩展欧几里得】
传送门:HDU 2769Disgruntled JudgeTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Problem DescriptionOnce upon a time, there was an nwerc judge with a tendency to...原创 2019-07-27 10:26:32 · 126 阅读 · 0 评论 -
点到直线和到线段的最短距离
点到直线的距离:struct Node{ int x,y;};double D(Node a,Node b,Node c)//计算点到直线距离{ double d=(fabs((b.y-a.y)*c.x+(a.x-b.x)*c.y+((b.x*a.y)-(a.x*b.y))))/(sqrt(pow(b.y-a.y,2)+pow(a.x-b.x,2))); return d;...原创 2019-07-27 14:37:08 · 1322 阅读 · 0 评论 -
HDU 2772 Matchsticks 【数学+规律】
传送门:HDU 2772MatchsticksTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Problem DescriptionMatchsticks are ideal tools to represent numbers. A common way to r...原创 2019-07-26 20:31:39 · 336 阅读 · 0 评论 -
GYM 101061G
传送门:GYM 101061G G. Repeat ittime limit per test2.0 smemory limit per test64 MBinputstandard inputoutputstandard outputProblem DescriptionJad has bought a new computer, a really weird comput...原创 2019-07-22 15:56:30 · 314 阅读 · 0 评论 -
多边形重心的计算
例题:传送门:HDU 1115方法一:累加求和重心。设平面上有n个点(xi,yi)(i=1、2、3……n),其多边形重心G(x,y)为:这是求多边形最简单直观的方法。可以直接利用数据点的x, y坐标就能求图形重心。但是缺陷在于没有对离散数据点所围图形做任何处理和分析,精度不够。方法二:这里有几个定理需要用到:定理一:已知三角形△A1A2A3的顶点坐标Ai ( xi, yi ...原创 2019-07-13 20:08:47 · 13263 阅读 · 2 评论 -
POJ 1850 Code 【组合数学】
传送门:POJ 1850CodeTime Limit: 1000MS Memory Limit: 30000KProblem DescriptionTransmitting and memorizing information is a task that requires different coding systems for the best use of the avail...原创 2019-07-13 16:56:10 · 107 阅读 · 0 评论