Sicily1218
来源:互联网 发布:js验证码不区分大小写 编辑:程序博客网 时间:2024/05/17 08:58
给WA脑残了,一直WA。
#include <cstdio>#include <iostream>using namespace std;int main(){ int N,M; while (scanf("%d",&N)!=EOF) { scanf("%d",&M); int counter=0; int L[100000],R[100000]; int div=2; int left,right; while (1) { if (div%2==0) { if (M%div==0.5*div) { left=M/div-(div/2-1); right=M/div+(div/2); if (left>=1 && right<=N) { L[counter]=left; R[counter]=right; counter++; } else break; } } else { if (M%div==0) { left=M/div-div/2; right=M/div+div/2; if (left>=1 && right<=N) { L[counter]=left; R[counter]=right; counter++; } else break; } } div++; } int i; for (i=counter-1;i>=0;i--) printf("[%d,%d]\n",L[i],R[i]); if (M<=N) printf("[%d,%d]\n",M,M); } return 0;}
- Sicily1218
- 设计模式优秀文章集合
- hive java.io.IOException: Cannot initialize Cluster
- ZOJ 3466 The Hive II 解题报告(插头DP)
- 为何过半农村学生无法就读普通高中?
- error LNK2019: unresolved external symbol
- Sicily1218
- oracle 安装oracle(图片缺失)
- Perl 环境变量设置
- MYSQL字符集与中文的问题的详细说明
- 玩数据库之MySQL
- 图片上传demo
- 数据结构-二叉树
- 计算机视觉领域的一些牛人博客,超有实力的研究机构等的网站链接
- iOS界面-仿网易新闻左侧抽屉式交互