HDOJ2058
来源:互联网 发布:网络进度计划要点 编辑:程序博客网 时间:2024/06/15 19:13
/*等差数列求和公式*/
#include <iostream>
#include <cstring>#include <string>
#include <cstdio>
#include <algorithm>
#include <stack>
#include <math.h>
#include<iostream>
using namespace std;
int main()
{
long long int m, n;
while (cin >> m >> n,m||n)
{
for (int i = sqrt(2*n); i > 0; i--) // 当和是m时 实际最多的位数(由等差数列求和公式推)
{
long long int a = n / i - (i - 1) / 2;
if((2*a+i-1)*i==2*n) cout << "[" << a << "," << a + i - 1 << "]" << endl;
}
cout << endl;
}
return 0;
}
阅读全文
0 0
- HDOJ2058
- HDOJ2058 The sum problem
- hdoj2058 The sum problem
- hdoj2058(the sum problem
- hdoj2058 The sum problem
- angular排序和删除
- 详解Java的跨平台性
- LWC 54:698. Partition to K Equal Sum Subsets
- 【Android View事件(二)】详解事件分发机制
- 求助用.net写一个截取图片并保存功能,最好能把做好的项目发给我 如果可以功能任务完成愿意50元支付宝报酬
- HDOJ2058
- Qt 之 模态、非模态、半模态窗口的介绍及 实现QDialog的exec()方法
- Popular Cows POJ
- 数据结构实验之链表二:逆序建立链表(STL)
- KMP算法之next数组详解 (转载)
- STM32+74HC595:带领你10分钟用对74HC595
- hdfs常用的Shell操作
- 各种依赖和一些设置
- mvc与MVP