Problem Description
HazelFan is given two positive integers a,b, and he wants to calculate amodb. But now he forgets the value of b and only remember the value of a, please tell him the number of different possible results.
 
Input
The first line contains a positive integer T(1≤T≤5), denoting the number of test cases.
For each test case:
A single line contains a positive integer a(1≤a≤109).
 
Output
For each test case:
A single line contains a nonnegative integer, denoting the answer.
 
Sample Input
2
1
3
 
 
Sample Output
2
3
 
题意:有两个正整数a,b。a已知,b未知,求a mod b有几种情况
题解:手算几个即可发现规律。以7为例,有如下5种情况 7(b>7),1(b==6||b==3||b==2),2(b==5),3(b==4),0(b==1||b==7);
 #include<iostream>
#include<cstdio>
using namespace std; int T;
long long a;
int main()
{
scanf("%d",&T);
while(T--)
{
scanf("%lld",&a);
printf("%lld\n",(a+)/+);
}
return ;
}

HDU 6124 17多校7 Euler theorem(简单思维题)的更多相关文章

  1. HDU 6140 17多校8 Hybrid Crystals(思维题)

    题目传送: Hybrid Crystals Problem Description > Kyber crystals, also called the living crystal or sim ...

  2. HDU 6034 17多校1 Balala Power!(思维 排序)

    Problem Description Talented Mr.Tang has n strings consisting of only lower case characters. He want ...

  3. 2019浙大校赛--G--Postman(简单思维题)

    一个思维水题 题目大意为,一个邮递员要投递N封信,一次从邮局来回只能投递K封.求最短的投递总距离.需注意,最后一次投递后无需返回邮局. 本题思路要点: 1.最后一次投递无需返回邮局,故最后一次投递所行 ...

  4. HDU 6143 17多校8 Killer Names(组合数学)

    题目传送:Killer Names Problem Description > Galen Marek, codenamed Starkiller, was a male Human appre ...

  5. HDU 6045 17多校2 Is Derek lying?

    题目传送:http://acm.hdu.edu.cn/showproblem.php?pid=6045 Time Limit: 3000/1000 MS (Java/Others)    Memory ...

  6. HDU 3130 17多校7 Kolakoski(思维简单)

    Problem Description This is Kolakosiki sequence: 1,2,2,1,1,2,1,2,2,1,2,2,1,1,2,1,1,2,2,1……. This seq ...

  7. HDU 6038 17多校1 Function(找循环节/环)

    Problem Description You are given a permutation a from 0 to n−1 and a permutation b from 0 to m−1. D ...

  8. HDU 6103 17多校6 Kirinriki(双指针维护)

    Problem Description We define the distance of two strings A and B with same length n isdisA,B=∑i=0n− ...

  9. HDU 6098 17多校6 Inversion(思维+优化)

    Problem Description Give an array A, the index starts from 1.Now we want to know Bi=maxi∤jAj , i≥2. ...

随机推荐

  1. hdu-3671-tarjin/割点方案

    http://acm.hdu.edu.cn/showproblem.php?pid=3671 给出一幅无向图,询问有多少种移除点对的方案使得剩下的连通分量个数大于1. 和上一题差不多的思路直接做n次t ...

  2. Beta阶段——第4篇 Scrum 冲刺博客

    Beta阶段--第4篇 Scrum 冲刺博客 标签:软件工程 一.站立式会议照片 二.每个人的工作 (有work item 的ID) 昨日已完成的工作 人员 工作 林羽晴 昨日完成获取提醒语句的接口函 ...

  3. visio画等分树状图

    一 树状图形状 Search里搜索Tree,找到Double Tree或者Multi Tree的形状 二 分出更多branch 按住主干上的黄色小方块,拖出更多分支. 三 等分分支 将每个分支和对应的 ...

  4. spring ,springmvc的常用标签注解

    一:spring常用的注解: @Configuration把一个类作为一个IoC容器,它的某个方法头上如果注册了@Bean,就会作为这个Spring容器中的Bean.@Scope注解 作用域@Lazy ...

  5. Segments

    Segments Given n segments in the two dimensional space, write a program, which determines if there e ...

  6. 二、持久层框架(Hibernate)

    一.Hibernate对象的状态 实体类对象在Hibernate中有3中状态:瞬时,持久,脱管. 瞬时:没有和Hibernate发生任何关系,在数据库中也没有对应的记录,一旦JVM结束,对象就消失了 ...

  7. ActiveMQ consumer按顺序处理消息

    http://activemq.apache.org/exclusive-consumer.html producer发送消息是有先后顺序的,这种顺序保持到了broker中.如果希望消息按顺序被消费掉 ...

  8. Oracle awr报告生成操作步骤

    1.登录主机切换到oracle用户 ssh root@192.168.220.128 su - oracle 2.以sysdba身份登录数据库 sqlplus / as sysdba 3.执行@?/r ...

  9. QPainter绘制特殊线条

    参考资料: https://www.cnblogs.com/Jace-Lee/p/5946342.html 效果图: 代码: void WgtText::paintEvent(QPaintEvent ...

  10. 神奇的口袋(dp)

    有一个神奇的口袋,总的容积是40,用这个口袋可以变出一 些物品,这些物品的总体积必须是40. John现在有n(1≤n ≤ 20)个想要得到的物品,每个物品 的体积分别是a1,a2……an.John可 ...