![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数学
文章平均质量分 56
数学
对你说的对
这个作者很懒,什么都没留下…
展开
-
HDU 2.2.5(平面划分问题)
(1) n条直线最多分平面问题题目大致如:n条直线,最多可以把平面分为多少个区域。析:可能你以前就见过这题目,这充其量是一道初中的思考题。但一个类型的题目还是从简单的入手,才容易发现规律。当有n-1条直线时,平面最多被分成了f(n-1)个区域。则第n条直线要是切成的区域数最多,就必须与每条直线相交且不能有同一交点。 这样就会得到n-1个交点。这些交点将第n条直线分为2条射线和n-2条线断。原创 2017-05-31 22:51:33 · 242 阅读 · 0 评论 -
HDU 约瑟夫环
约瑟夫环问题:一圈共有N个人,开始报数,报到M的人自杀,然后重新开始报数,问最后自杀的人是谁?HDU 2.2.2/*#includeusing namespace std;int joseph[10001];int ans[10001];int main(){ int k; while(cin>>k&&k) { i原创 2017-05-31 23:28:06 · 286 阅读 · 0 评论 -
HDU 最大公约数和最小公倍数
最大公约数1、辗转相除法int gcd(int x,int y){ if(x>y) { int m=x; int n=y; } else { m=y; n=x; } int r=n; while(r) { r原创 2017-05-26 09:01:04 · 424 阅读 · 2 评论 -
HDU5973 Game of Taking Stones(博弈+牛顿迭代开根法)
Two people face two piles of stones and make a game. They take turns to take stones. As game rules, there are two different methods of taking stones: One scheme is that you can take any number of ston...原创 2018-10-04 20:46:57 · 162 阅读 · 0 评论 -
ACM-ICPC 2018 焦作赛区网络预赛------Give Candies(费马小定理降幂)
There are N children in kindergarten. Miss Li bought them N candies. To make the process more interesting, Miss Li comes up with the rule: All the children line up according to their student number (1...原创 2018-09-18 11:55:03 · 160 阅读 · 0 评论 -
排列组合---隔板法
1、定义 隔板法就是在n个元素间插入(b-1)个板,即把n个元素分成b组的方法。C(n-1,b-1) 2、条件 隔板法必须满足三个条件: (1)这n个元素必须相同,(2)所分成的每一组至少分得一个元素,(3)分成的组别彼此差异。 3、示例 (1)例如:某校组建一球队需16人,该校共10个班级,且每个班至少分配一个名额,共有几种情况。C(16-1,10-1)。 ...原创 2018-08-16 09:50:22 · 18430 阅读 · 0 评论 -
组合数模板
#include <bits/stdc++.h>using namespace std;typedef long long ll;const ll MOD=998244353;const ll MAXN=262144+5;ll a[MAXN];ll fact[MAXN],ifact[MAXN];//fact[i]是i的阶乘,ifact[i]是阶乘的除法逆元,两者用于求...原创 2018-08-15 21:51:01 · 153 阅读 · 0 评论 -
牛客2018多校训练------Filling pools(组合数)
链接:https://www.nowcoder.com/acm/contest/146/B来源:牛客网时间限制:C/C++ 3秒,其他语言6秒空间限制:C/C++ 262144K,其他语言524288K64bit IO Format: %lld题目描述Niuniu is interested in a game. The goal of the game is to fill...原创 2018-08-13 11:30:21 · 621 阅读 · 0 评论 -
牛客小白月赛----圆(circle)(欧拉公式)
链接:https://www.nowcoder.com/acm/contest/135/F来源:牛客网时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 32768K,其他语言65536K64bit IO Format: %lld题目描述 签到题来了,送你们一个Python秒的题。 Apojacsleam来到了OI大陆,经过了连年征战,成为了一方国王...原创 2018-08-13 10:41:01 · 313 阅读 · 0 评论 -
牛客多校训练------Counting regions(欧拉公式)
链接:https://www.nowcoder.com/acm/contest/146/G来源:牛客网时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 131072K,其他语言262144K64bit IO Format: %lld题目描述Niuniu likes mathematics. He also likes drawing pictures. One d...原创 2018-08-13 10:36:25 · 327 阅读 · 0 评论 -
2018牛客多校训练----Heritage of skywalkert(随机数+打表规律题)
链接:https://www.nowcoder.com/acm/contest/144/J来源:牛客网题目描述skywalkert, the new legend of Beihang University ACM-ICPC Team, retired this year leaving a group of newbies again.Rumor has it that h...原创 2018-08-05 19:35:31 · 285 阅读 · 0 评论 -
2018牛客多校训练----gpa(分数规划+二分)
链接:https://www.nowcoder.com/acm/contest/143/A来源:牛客网题目描述Kanade selected n courses in the university. The academic credit of the i-th course is s[i] and the score of the i-th course is c[i].At ...原创 2018-08-02 21:10:13 · 314 阅读 · 0 评论 -
Game (博弈+DP)
链接:https://www.nowcoder.com/acm/contest/123/G来源:牛客网题目描述 Alice and Bob are playing a stone game. There are n piles of stones. In each turn, a player can remove some stones from a pile (the number must...原创 2018-05-20 15:32:31 · 273 阅读 · 1 评论