C - Fafa and his Company
Problem description
Fafa owns a company that works on huge projects. There are n employees in Fafa's company. Whenever the company has a new project to start working on, Fafa has to divide the tasks of this project among all the employees.
Fafa finds doing this every time is very tiring for him. So, he decided to choose the best l employees in his company as team leaders. Whenever there is a new project, Fafa will divide the tasks among only the team leaders and each team leader will be responsible of some positive number of employees to give them the tasks. To make this process fair for the team leaders, each one of them should be responsible for the same number of employees. Moreover, every employee, who is not a team leader, has to be under the responsibility of exactly one team leader, and no team leader is responsible for another team leader.
Given the number of employees n, find in how many ways Fafa could choose the number of team leaders l in such a way that it is possible to divide employees between them evenly.
Input
The input consists of a single line containing a positive integer n (2 ≤ n ≤ 105) — the number of employees in Fafa's company.
Output
Print a single integer representing the answer to the problem.
Examples
Input
2
Output
1
Input
10
Output
3
Note
In the second sample Fafa has 3 ways:
- choose only 1 employee as a team leader with 9 employees under his responsibility.
- choose 2 employees as team leaders with 4 employees under the responsibility of each of them.
- choose 5 employees as team leaders with 1 employee under the responsibility of each of them.
解题思路:结合提示,再多举几个栗子,将会发现问题求解其实是求n的因子个数(不包括n),水过!
AC代码:
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
int num=;
for(int i=;i<=n/;++i)
if(n%i==)num++;
cout<<num<<endl;
return ;
}
C - Fafa and his Company的更多相关文章
- Elasticsearch索引(company)_Centos下CURL增删改
目录 返回目录:http://www.cnblogs.com/hanyinglong/p/5464604.html 1.Elasticsearch索引说明 a. 通过上面几篇博客已经将Elastics ...
- Microsoft Dynamics AX 2012: How to get Company,Customer and Vendor address in AX 2012
Scenario: “How to get Addresses of “Customer, Vendor and Company” 1) First we need to identify ...
- poj1416 Shredding Company
Shredding Company Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 5379 Accepted: 3023 ...
- CodeForces 125E MST Company
E. MST Company time limit per test 8 seconds memory limit per test 256 megabytes input standard inpu ...
- CF 321B Kefa and Company(贪心)
题目链接: 传送门 Kefa and Company time limit per test:2 second memory limit per test:256 megabytes Desc ...
- 搜索+剪枝 POJ 1416 Shredding Company
POJ 1416 Shredding Company Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 5231 Accep ...
- 二分+动态规划 POJ 1973 Software Company
Software Company Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 1112 Accepted: 482 D ...
- 【Moqui业务逻辑翻译系列】Story of Online Retail Company 在线零售公司的故事
h1. Story of Online Retail Company 在线零售公司的故事 Someone decides to sell a product. [Product Marketer Ma ...
- Codeforces 556D Restructuring Company
传送门 D. Restructuring Company time limit per test 2 seconds memory limit per test 256 megabytes input ...
随机推荐
- unzip 命令巧用举例
1.把文件解压到当前目录下 unzip master.zip 2.如果要把文件解压到指定的目录下,需要用到-d参数. unzip -d /tmp master.zip 3.解压的时候,有时候不想覆盖已 ...
- copy.c实现
#cat copy.c #include <stdio.h> #include <stdlib.h> #include <string.h> int copyFil ...
- 洛谷——P4014 分配问题
P4014 分配问题 题目描述 有 nn 件工作要分配给 nn 个人做.第 ii 个人做第 jj 件工作产生的效益为 c_{ij}cij .试设计一个将 nn 件工作分配给 nn 个人做的分配方案, ...
- 解决WP程序 重复打开出现 “正在加载...” 字样 解决方案
在开发winphone程序时候 我们经常遇到调试.在调试的时候 可能会重复打开 debug一下.可是有时候 经常遇到 "正在加载...."字样.而且很慢.效率很低. 测试发现 在 ...
- Java基础学习总结(69)——匿名内部类与Lambda表达式
前言 Java Labmda表达式的一个重要用法是简化某些匿名内部类(Anonymous Classes)的写法.实际上Lambda表达式并不仅仅是匿名内部类的语法糖,JVM内部是通过invokedy ...
- [luoguP2024] 食物链(并查集)
传送门 经典的并查集问题 对于这种问题,并查集需要分类 开3*n的并查集,其中x用来连接与x同类的,x+n用来连接x吃的,x+2*n用来连接x被吃的. 1 x y时,如果 x吃y 或 x被y吃,那么为 ...
- [bzoj2502]清理雪道[上下界网络流]
bzoj状态里有两种,一种时间是个位数,一种是四位数,我就是四位数的那种,,,估计都是看了hzwer.. #include <bits/stdc++.h> #define INF 0x3f ...
- 【ACM】nyoj_106_背包问题_201308152026
背包问题时间限制:3000 ms | 内存限制:65535 KB 难度:3描述 现在有很多物品(它们是可以分割的),我们知道它们每个物品的单位重量的价值v和重量w(1<=v,w<=10 ...
- php svn仓库提交预处理
需要做的事情 1.检查是否填写注释2.php文件是否有语法错误 pre-commit脚本 hook脚本名称:hooks/pre-commit REPOS="$1" TXN=&quo ...
- 软件测试之怎么避免Bug漏测?
一.对需求评审阶段,对业务需求细节理解不明确,未深入挖掘隐含拓展需求 改进措施 需求评审前,我们应该先仔细阅读prd及交互文档,先形成自己对产品的思考,通过脑图的方式列出对产品设计的疑问点,从用户或者 ...