codeforces 935 A. Fafa and his Company

CodeForces - 935A Fafa and his Company [带修改莫队] 阅读详情

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个人划分成若干个小组,且每个小组至少两个人的方案数。
思路:求真因子的个数

#include <stdio.h>
int n;
int main() {
    scanf("%d", &n);
    int ans = 1,i;
    for ( i = 2; i*i < n; ++i) {
        if (n%i == 0)ans += 2;
    }
    //i*i==n
    if (i*i == n)ans += 1;
    printf("%d", ans);
}
CST软件中SPICE模型的高效导出与转换技巧(txt到cir实战指南) 本文详细介绍了在CST Studio Suite中高效导出与转换SPICE模型的实战技巧,重点讲解了如何将txt格式的模型转换为通用的cir格式。内容涵盖三种模型存在形式的处理方法、格式检查与内容清理、端口一致性验证等关键步骤,并提供了利用LTspice Export功能、批处理脚本以及结果一致性校验等进阶指南,帮助工程师实现场路协同仿真模型的无缝迁移与应用。 阅读详情

相关推荐

Flowable前端可视化配置动态审批人:告别硬编码,实现部门领导、项目经理自动分配

本文详细介绍了Flowable前端可视化配置动态审批人的全栈解决方案,通过表达式分配、监听器分配等动态审批人机制,实现从硬编码到智能分配的转变。文章提供了前端扩展bpmn-js设计器、后端动态解析实现方案及性能优化建议,帮助企业应对组织架构变动,提升审批流程的灵活性和效率。

weixin_30352645的博客 471

A. Fafa and his Company

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...

码农的一亩三分地 514

绿联UGOS Pro系统虚拟机部署Windows 11详细教程(跳账户登录,安装内存驱动)

总的来说,此次的虚拟机部署Windows 11出现的问题应该是目前几乎所有虚拟机都可能出现的问题,和绿联是没有关系的。所以说如果你在其它NAS上虚拟机部署Windows 11系统如果出现同样的问题,那么今天教程的方案也同样适用于你。

qq_63499861的博客 1万+

fafa

 package fafa; class queue{  public static final int SIZE=1000;  public int[] x;  public int[] y;  public int x_fornt;  public int x_rear;  public int y_fornt;  public int y_rear;  public

xyjqaqforever的博客 296

使用光流进行 Warp 的流程

光流描述了图像帧中每个像素的运动。前向光流:描述了帧中每个像素在帧中的移动位置。后向光流:描述了帧中每个像素在帧​ 中的移动位置。水平方向的位移(x 方向),即每个像素水平移动了多少像素。垂直方向的位移(y 方向),即每个像素垂直移动了多少像素。使用光流进行 Warp 的流程Warp 是通过光流对图像进行变换的操作,旨在将前一帧的像素根据光流场映射到下一帧的对应位置。Step 1: 计算光流我们首先需要通过光流网络(如 RAFT)来估算两帧之间的光流。我们可以获得前向光流(从帧​ 到帧。

qq_44199605的博客 2108

STM32F103C8T6+I2C+DMA读取陀螺仪模块JY901S(硬件I2C

说明:1.本实验代码适用移植一切stm32f1系列;2.本实验使用的是外设资源硬件I2C2;3.本实验运用的是DMA单次模式,如果需要DMA的循环模式,请移步我的另一篇文章;4.本文章不提供陀螺仪校准教学,并是在没有校准陀螺仪情况下读取数据;5.本文章是作者的学习记录及心得,如有不足,欢迎指正。 总结:亲测stm32f103c8t6最小系统板通过片上外设资源I2C配合DMA读去陀螺仪模块jy901s偏航角有效。

anquanyuanqqadsy的博客 6170

新生赛003 E fafa在分配工作

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...

JustMessifans的博客 271

java实现自动发送微信QQ消息(可发图片)

自动发送微信/QQ/微博等消息 一:功能:实现发送QQ/微信/微博消息,程序控制。 效果演示(实现自动发生QQ微信消息给女友,发微博信息也可以就不演示了) 二:原理讲解:将剪贴板的内容给发送到QQ微信中去,复制粘贴发送。 模拟真实操作进行发送信息。 三:前期准备,软件安装,及初步测试。...

XURUNFA950827的博客 1万+

法法在分配工作

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 amon...

qq_45793174的博客 218

工业激光器核心参数详解与选型实战:从理论到产线落地(五)

本文深入解析了脉冲激光加工的三大核心参数——脉宽、重复频率和脉冲能量的协同作用机制。通过公式推导和产线案例,揭示了参数设置对加工良率的关键影响:1. 脉宽决定热影响区大小,缩短脉宽可显著提升加工精度;2. 重复频率影响加工速度和热积累效应,需平衡效率与质量;3. 脉冲能量决定材料去除量,过大易导致加工缺陷。文中以ABS塑料打标、模具清洗和微孔钻孔为例,展示了参数优化如何将良率从65%提升至99%,并提供了不同应用场景的参数选型表和调试技巧,强调峰值功率比平均功率更具决定性作用。

weixin_44520581的博客 2421

【DRAM存储器六十八】DDR5介绍--DQS Interval Oscillator—动态时序校准利器

DDR5内存采用DQS间隔振荡器(DQSIntervalOscillator)技术应对高速数据传输中的时序漂移问题。该技术通过测量DQS信号在可编程时间窗口内的振荡次数(16位计数值),动态监测温度/电压变化导致的DQS-DQ延迟偏移。控制器通过MPC命令启停振荡器,读取MR46/MR47寄存器获取计数值,并与基准值对比来调整DQS相位,确保数据采样窗口始终处于最佳位置。该机制使DDR5在8400MT/s高速率下仍能保持数据可靠性,有效补偿±0.48tCK的时序偏移。

highman110的博客 149

Codeforces Round #465 (Div. 2) A. Fafa and his Company

A. Fafa and his CompanyFafa 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 task...

s540239976的博客 564

WINCC7.3破解文件

WINCC7.3硬件够破解文件,有需要的下载!WINCC7.3硬件够破解文件,有需要的下载!

codeforces 935A Fafa and his Company

点击打开链接 A. Fafa and his Company time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Fafa owns a company th

zhang__liuchen的博客 443

ssm框架搭建

这个是一个在idea上成功跑起来的ssm框架项目,保存在这里方便以后使用直接下载

C# WinForm 基于DirectShow.dll编写的程序,可边预览边保存视频,音频和图片

基于微软的DirectShow.dll的二次开发1.自动识别连接的摄像头跟麦克风且可以对其进行选择(默认选中第一个)2.可录制wmv和avi两种格式的视频并且都带有音频,avi可以录制的分辨率和帧数进行选择,wmv默认进行了淸晰度优化如不喜欢可去除代码中有相关提示3.可在预览点开之后进行拍照,也可边录制视频边拍照4.添加了视频和音频的压缩功能(酌情使用)这次二次开发发现C#对DirectShow的相关信息太少,这次做完也不敢藏私共享出来,还望大家指正

Codeforces 935A Fafa and his Company

题意:    n名员工分为几个小组可以平均分开。小组数不为1分析:    求非自身的因子数。#include&lt;bits/stdc++.h&gt; using namespace std; #define mp make_pair #define LL long long #define N 10005 #define inf 0x3f3f3f3f int main(){ int n;...

努力打工 269

【CodeForces】【水题】【暴力】935 A Fafa and his Company

【题目】http://codeforces.com/problemset/problem/935/A 【题意】有n个人,现在要选几个leader,让其他人成为这个leader的下属,每个leader都要有相同数量的下属,每个人都要成为leader或者下属,下属的数量不能是0,问有多少种分配方案? 【思路】分别让1,2,3,……n-1个人成为leader,判断剩下的人数能否被leader的个数整...

swqeaaa的博客 276

A. Fafa and his Company(思维题)Codeforces Round #465 (Div. 2)

原题链接:http://codeforces.com/problemset/problem/935/A 题意:有n个员工,从中选取i个领导人,要求每个领导人带的员工是相同的,且领导人带的员工数目不能为0。求选取的方案数 解题思路:我们可以这样思考,最少可以有1个领导人,最多可以有n/2个领导人。那么我们再看看选取的成立条件,我们选完i个领导人之后还剩n-i个员工,如果这些员工能平分给i个领导人,那么就符合条件,所以我们只需要遍历从1到n/2判断可不可行,统计方案数即可。 AC代码: /* *邮箱:2825

pursuit的博客 518

Codeforces Round #465 (Div. 2) A. Fafa and his Company 水题

A. Fafa and his Companytime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputFafa owns a company that works on huge projects. There are n employees in Fa...

Frost_Bite的博客 754

AtCoder Beginner Contest 085 D Katana Thrower(贪心)

Problem Statement You are going out for a walk, when you suddenly encounter a monster. Fortunately, you have N katana (swords), Katana 1, Katana 2, …, Katana N, and can perform the following two kind

toby的博客 928

codeforces 922 C Cave Painting

能同时满足n mod i = i -1 (i = 1, 2, 3, ..., k)的n有多少个呢?

toby的博客 898

codeforces 914 D Bash and a Tough Math Puzzle

结合了gcd的线段树,每个区间结点维护的都是这个区间的gcd。单点更新。每次询问需要检查 x 相对于[l, r]的gcd是否为almost right(如果只修改一个叶子结点就能让区间[l, r]的gcd变成x)

toby的博客 854

2018 CCCC天梯赛 L2 04 秀恩爱分得快

所以说,秀恩爱真的让人头大orz

toby的博客 840

codeforces 916 A Jamie and Alarm Snooze

一道很简单的模拟题。

toby的博客 838

codeforce 915 B Browser

Luba is surfing the Internet. She currently has n opened tabs in her browser, indexed from 1 to n from left to right. The mouse cursor is currently located at the pos-th tab. Luba needs to use the tab

toby的博客 783

codeforces 922 D Robot Vacuum Cleaner

抽象化字符串,再利用贪心对他们排序

toby的博客 760
上一篇: codeforces 931 D. Peculiar apple-tree
下一篇: codeforces 935 B. Fafa and the Gates
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值