Hust oj 1279 切蛋糕(简单数学)
来源:互联网 发布:不会函数能学编程吗 编辑:程序博客网 时间:2024/04/29 03:25
切蛋糕Time Limit: 1000 MSMemory Limit: 65536 KTotal Submit: 218(79 users)Total Accepted: 72(65 users)Rating: Special Judge: NoDescription有一个非常大的蛋糕,现在有一个圆形的杯子可以从正面倒扣到上面的方式把蛋糕分为一块一块的,杯子的厚度忽略不计。现在规定可以用杯子n次要求m个人每人至少分一块,是否能满足?Input
每行输入两个整数n, m,(0 < n ,m< 10000000)
处理到文件结束
Output输出结果占一行,满足的话输出所有人中某个人最多能得到多少块
否则输出”N\n”
Sample Input1 2
1 3
Sample Output1
N\n
问n个圆最多能把平面分成几份
#include<cstdio>#include<iostream>using namespace std;int main(){ long long int n,m; while(~scanf("%lld%lld",&n,&m)) { long long int sum = n*n - n + 2; if(sum < m) printf("N\\n\n"); else printf("%lld\n",sum-m+1); }}
0 0
- Hust oj 1279 切蛋糕(简单数学)
- Hust oj 1632 最大的最小公倍数(简单数学)
- Hust oj 1305 多边形(数学)
- 切蛋糕&切西瓜(数学)
- Hust oj 1184 早起一水(简单贪心)
- Hust oj 2084(大数)
- Hust oj 2038 联系网络(MST)
- Hust oj 2234 土豪银行(贪心)
- Hust oj 1143 泉水(dfs)
- Hust oj 2113 Count(Map)
- Hust oj 1677 一个函数(栈)
- Hust oj 1039 修路(二分)
- Hust oj 1369 Buy Computers(水题)
- Hust oj 2121 你猜猜(水题)
- Hust oj 2005 排列问题(STL)
- Hust oj 1559 线段相交(叉积)
- Hust oj 2106 Genuine Messages(字符串)
- Hust oj 2235 毒(水题)
- hdoj5428 The Factor
- 工厂模式
- N - Mafia Codeforces 348A
- 2016长乐夏令营 Day13
- 枚举与常量类的区别
- Hust oj 1279 切蛋糕(简单数学)
- hdoj4497
- JSON
- awakeFromNib和initWithFrame分别什么时候调用
- Scala基础(3):流程控制
- static关键字
- php中echo/print/print_r()/var_dump()的区别
- hdoj5742 It's All In The Mind
- SQL Server存储过程输入参数使用表值