1049. Brave Balloonists

博客介绍了1049. Brave Balloonists,包含Input、Output、Sample等内容,还给出了转载来源https://www.cnblogs.com/sdau--codeants/p/3251031.html 。

1049. Brave Balloonists

Time limit: 2.0 second Memory limit: 64 MB
Ten mathematicians are flying on a balloon over the Pacific ocean. When they are crossing the equator they decide to celebrate this event and open a bottle of champagne. Unfortunately, the cork makes a hole in the balloon. Hydrogen is leaking out and the balloon is descending now. Soon it will fall into the ocean and all the balloonists will be eaten by hungry sharks.
But not everything is lost yet. One of the balloonists can sacrifice himself jumping out, so that his friends would live a little longer. Only one problem still exists: who is the one to get out. There is a fair way to solve this problem. First, each of them writes an integer ai not less than 1 and not more than 10000. Then they calculate the magic number N that is the number of positive divisors of the product a1*a2*…*a10. For example, the number of positive integer divisors of 6 is 4 (they are 1,2,3,6). The hero (a mathematician who will be thrown out) is determined according to the last digit of N. Your task is to find this digit.

Input

Input contains ten integer numbers (each number is in separate line).

Output

Output a single digit from 0 to 9 — the last digit of N.

Sample

inputoutput
1
2
6
1
3
1
1
1
1
1
9
Problem Author: Stanislav Vasilyev Problem Source: Ural State University collegiate programming contest (25.03.2000)
***************************************************************************************
求因子的个数=连乘(ai+1);ai为质因子的个数。
***************************************************************************************
 1 #include<iostream>
 2 #include<cstring>
 3 #include<string>
 4 #include<cstdio>
 5 #include<cmath>
 6 using namespace std;
 7 int su[10003];
 8 bool  p[10003];
 9 int ks,sm;
10 int sum[10003];
11 void  find(int x)
12 {
13     int m=x;
14     m+=x;
15     while(m<=10001)
16      {
17          p[m]=true;
18          m+=x;
19      }
20 }
21 void  sushu()
22 {
23     for(int iv=2;iv<=10001;iv++)
24      {
25          if(!p[iv])
26          {
27               find(iv);
28               su[++ks]=iv;
29          }
30 
31      }
32 }
33 int main()
34 {
35     int a;
36     ks=0;
37     int i,ds;
38     memset(p,false,sizeof(p));
39     memset(su,0,sizeof(su));
40     sushu();
41     memset(sum,0,sizeof(sum));
42     for(i=1;i<=10;i++)
43      {
44          cin>>a;
45          ds=1;
46          while(a>1)
47          {
48              while(a%su[ds]==0&&a>1&&su[ds]<=a)
49                {
50                    a=a/su[ds];
51                    ++sum[ds];
52                 }
53             ds++;
54          }
55      }
56     sm=1;
57     for(i=1;i<=ks;i++)
58      {
59          //cout<<sum[i]<<endl;
60     sm=sm*(sum[i]+1);
61     //cout<<num%10<<endl;
62     }
63     cout<<sm%10<<endl;
64     return 0;
65 }
View Code

 

转载于:https://www.cnblogs.com/sdau--codeants/p/3251031.html

源码地址: https://pan.quark.cn/s/3916362e5d0a 在C#编程平台下,构建一个曲线编辑器是一项融合了图形用户界面(GUI)构建、数据管理及数学运算的应用开发任务。 接下来将系统性地介绍这个曲线编辑器开发过程中的核心知识点:1. **定制曲线面板展示数据曲线**: - 控件选用:在C#的Windows Forms或WPF框架中,有多种控件可用于曲线呈现,例如PictureBox或用户自定义的UserControl。 通过处理重绘事件,借助Graphics对象执行绘图动作,如运用DrawCurve方法。 - 数据图形化:通过线性或贝塞尔曲线连接数据点,以呈现数据演变态势。 这要求掌握直线与曲线的数学描述,例如两点间的直线公式、三次贝塞尔曲线等。 - 坐标系统与缩放比例:构建X轴和Y轴,设定坐标标记,并开发缩放功能,使用户可察看不同区间内的数据。 2. **在时间轴上配置多个关键帧数据**: - 时间轴构建:开发一个时间轴组件,显示时间单位刻度,并允许用户在特定时间点设置关键帧。 时间可表现为连续形式或离散形式,关键帧对应于时间轴上的标识。 - 关键帧维护:利用数据结构(例如List或Dictionary)保存关键帧,涵盖时间戳和关联值。 需考虑关键帧的添加、移除及调整位置功能。 3. **调整关键帧数据,通过插值方法获得曲线**: - 插值方法:依据关键帧信息,选用插值方法(如线性插值、样条插值,特别是Catmull-Rom样条)生成平滑曲线。 这涉及数学运算,确保曲线在关键帧之间无缝衔接。 - 即时反馈:在编辑关键帧时,即时刷新曲线显示,优化用户体验。 4. **曲线数据的输**: - 文件类型:挑选适宜的文件格式存储数据,例如XML、JSON或...
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符  | 博主筛选后可见
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值