黑龙江省2010年省赛

2024-08-31 00:58
文章标签 2010 省赛 黑龙江省

本文主要是介绍黑龙江省2010年省赛,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

数论题+打表题,因子和,模板打就好。


1008: Friends number

时间限制:  1 Sec   内存限制:  128 MB
提交:  360   解决:  99
[ 提交 ][ 状态 ][ 讨论版 ]

题目描述

Paula and Tai are couple. There are many stories between them. The day Paula left by airplane, Tai send one message to telephone 2200284, then, everything is changing… (The story in “the snow queen”).

After a long time, Tai tells Paula, the number 220 and 284 is a couple of friends number, as they are special, all divisors of 220’s sum is 284, and all divisors of 284’s sum is 220. Can you find out there are how many couples of friends number less than 10,000. Then, how about 100,000, 200,000 and so on.

The task for you is to find out there are how many couples of friends number in given closed interval [a,b]

输入

There are several cases.

Each test case contains two positive integers a, b(1<= a <= b <=500,000).

Proceed to the end of file.

输出

For each test case, output the number of couples in the given range. The output of one test case occupied exactly one line.

样例输入

1 100
#include<cstdio>
#include<iostream>
#include<cmath>
#include<cstdlib>
#include<algorithm>
#include<cstring>
using namespace std;
int main()
{int a,b;int sum=0;while(scanf("%d%d",&a,&b)!=EOF){sum=0;if(a<=220&&b>=284)sum++;if(a<=1184&&b>=1210)sum++;if(a<=2620&&b>=2924)sum++;if(a<=5020&&b>=5564)sum++;if(a<=6232&&b>=6368)sum++;if(a<=10744&&b>=10856)sum++;if(a<=12285&&b>=14595)sum++;if(a<=17296&&b>=18416)sum++;if(a<=63020&&b>=76084)sum++;if(a<=66928&&b>=66992)sum++;if(a<=67095&&b>=71145)sum++;if(a<=69615&&b>=87633)sum++;if(a<=79750&&b>=88730)sum++;if(a<=100485&&b>=124155)sum++;if(a<=122265&&b>=139815)sum++;if(a<=122368&&b>=123152)sum++;if(a<=141664&&b>=153176)sum++;if(a<=142310&&b>=168730)sum++;if(a<=171856&&b>=176336)sum++;if(a<=176272&&b>=180848)sum++;if(a<=185368&&b>=203432)sum++;if(a<=196724&&b>=202444)sum++;if(a<=280540&&b>=365084)sum++;if(a<=308620&&b>=389924)sum++;if(a<=319550&&b>=430402)sum++;if(a<=356408&&b>=399592)sum++;if(a<=437456&&b>=455344)sum++;if(a<=469028&&b>=486178)sum++;if(a<=503056&&b>=514736)sum++;if(a<=522405&&b>=525915)sum++;if(a<=600392&&b>=669688)sum++;if(a<=609928&&b>=686072)sum++;if(a<=624184&&b>=691256)sum++;if(a<=635624&&b>=712216)sum++;if(a<=643336&&b>=652664)sum++;if(a<=667964&&b>=783556)sum++;if(a<=726104&&b>=796696)sum++;if(a<=802725&&b>=863835)sum++;if(a<=879712&&b>=901424)sum++;if(a<=898216&&b>=980984)sum++;if(a<=947835&&b>=1125765)sum++;if(a<=998104&&b>=1043096)sum++;if(a<=1077890&&b>=1099390)sum++;if(a<=1154450&&b>=1189150)sum++;if(a<=1156870&&b>=1292570)sum++;if(a<=1175265&&b>=1438983)sum++;if(a<=1185376&&b>=1286744)sum++;if(a<=1280565&&b>=1340235)sum++;if(a<=1328470&&b>=1483850)sum++;if(a<=1358595&&b>=1486845)sum++;if(a<=1392368&&b>=1464592)sum++;if(a<=1466150&&b>=1747930)sum++;if(a<=1468324&&b>=1749212)sum++;if(a<=1511930&&b>=1598470)sum++;if(a<=1669910&&b>=2062570)sum++;if(a<=1798875&&b>=1870245)sum++;if(a<=2082464&&b>=2090656)sum++;if(a<=2236570&&b>=2429030)sum++;if(a<=2652728&&b>=2941672)sum++;if(a<=2723792&&b>=2874064)sum++;if(a<=2728726&&b>=3077354)sum++;if(a<=2739704&&b>=2928136)sum++;if(a<=2802416&&b>=2947216)sum++;if(a<=2803580&&b>=3716164)sum++;if(a<=3276856&&b>=3721544)sum++;if(a<=3606850&&b>=3892670)sum++;if(a<=3786904&&b>=4300136)sum++;if(a<=3805264&&b>=4006736)sum++;if(a<=4238984&&b>=4314616)sum++;if(a<=4246130&&b>=4488910)sum++;if(a<=4259750&&b>=4445050)sum++;printf("%d\n",sum);}return 0;
}

1 1000

样例输出

0
1

提示


6 is a number whose sum of all divisors is 6. 6 is not a friend number, these number is called Perfect Number.


来源

辽宁省赛2010



这篇关于黑龙江省2010年省赛的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/1122437

相关文章

找不同-第15届蓝桥省赛Scratch初级组真题第4题

[导读]:超平老师的《Scratch蓝桥杯真题解析100讲》已经全部完成,后续会不定期解读蓝桥杯真题,这是Scratch蓝桥杯真题解析第183讲。 如果想持续关注Scratch蓝桥真题解读,可以点击《Scratch蓝桥杯历年真题》并订阅合集,查阅教程更方便。 第15届蓝桥杯省赛已于2024年8月24日落下帷幕,编程题一共有5题,分别如下: 猪八戒落地 游乐场 画西瓜 找不同 消

第十五届蓝桥杯图形化省赛题目及解析

第十五届蓝桥杯图形化省赛题目及解析 一. 单选题 1. 运行以下程序,角色会说( )? A、29     B、31     C、33     D、35 正确答案:C 答案解析: 重复执行直到m>n不成立,即重复执行直到m<=n。所有当m小于或者 等于n时,循环结束。循环过程中变量m与变量n的变化如下表: 通过上述表格可知,循环到第五次循环结束。m的值为14,n的值为19

【系统架构设计师-2010年】综合知识-答案及详解

更多内容请见: 备考系统架构设计师-核心总结索引 文章目录 【第1题】【第2题】【第3题】【第4~5题】【第6题】【第7~8题】【第9题】【第10题】【第11题】【第12题】【第13题】【第14题】【第15题】【第16题】【第17题】【第18题】【第19题】【第20题】【第21题】【第22题】【第23题】【第24题】【第25题】【第26~27题】【第28题】【第29~30题】【第31

九度考研真题 浙大 2010-2浙大1006:ZOJ问题

//题目1006:ZOJ问题 #include<iostream> #include<string.h> using namespace std; int main() { char s[1010]; char a[1010];//开始部分 char b[1010]; //中间部分  char c[1010];//后部分  int num1=0,n

九度考研真题 浙大 2010-1浙大1003:A+B

//题目1003:A+B #include<iostream> #include<string.h> using namespace std; int main() { int n1,n2; int s1[12],s2[12]; int s[12]; char c1[20],c2[20]; while(cin>>c1){ n1=0,n2=0;

在Visual Studio 2010中开发Qt程序

本文演示如何用VS2010开发QT的应用程序界面,前提是已经搭建好了开发环境,搭建方法很简单,我在之前的博客也有描述。此处不再赘述。 1.打开VS2010的IDE开发环境,新建一个QT Application的项目命名为QtGrapher,所有的设置都可以保持默认,创建完成后可以编译运行程序,如果环境配置都正确,会弹出一个空白的GUI界面,如下所示, 2.在IDE的解决方案资源管理器中双

QT+VTK+Visual Studio 2010联合开发

QT+VTK+Visual Studio 2010联合开发 由于开发VTK程序是需要的GUI环境需求比较苛刻,传统的MFC框架在开发简单的GUI程序时还行,稍微复杂一点的程序就显得生硬。因此在开源社区里,开发VTK的GUI程序时,普遍采用QT。以下简单描述这三者的关系。 准备工作,这三者应该提前安装,建议遵循安装顺序为先Visual Studio 2010,再按装QT,再按装CMake,最后安

QT与Visual Studio 2010整合的例子

做GUI界面的设计时,目前已不再拘泥于VS的MFC框架,有很多开源的工具。本例以QT与VS2012的整合为例,演示环境搭建,后续将会用QT做VT的开发工作。 第一步,下载QT和QT与VS的插件,在VS2010下以及结合VTK的情况,网络上经网友实验后效果比较好的版本如下: 1. QT:因为是与VS2010整合,所以选择版本:qt-win-opensource-4.8.5-vs2010.exe,

2010年

D C C 答案D 后续序列d b c a C B (不会)A   哈夫曼树中没有度为1的结点 A  答案C 注意题目 在任何情况下,假设六个点构成完全无向图 6(6-1)2=15,再加上第七个点 15+1=16 B B D A 装载因子        表中记录数/表长 可以算出表长 0.7=7/x         x=10

湖南省2010年省赛

汽水瓶 Time Limit: 1000ms, Special Time Limit:2500ms, Memory Limit:65536KBTotal submit users: 110, Accepted users: 110Problem 10930 : No special judgementProblem description  有这样一道智力题:“某商店规定:三个空汽水瓶可以换一瓶