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. Matlab-8:松弛迭代法(SOR)

    function [x,n,flag]=sor(A,b,eps,M,max1) %sor函数为用松弛迭代法求解线性方程组 %A为线性方程组的系数矩阵 %b为线性方程组的常数向量 %eps为精度要求 % ...

  2. CF-503div2-A/B/C

    A. New Building for SIS time limit per test 1 second memory limit per test 256 megabytes input stand ...

  3. 2017-3-31/socket

    1. 讲讲你对套接字编程的理解,它的协议是如何的? socket通常称为"套接字",用于描述IP地址和端口,是一个通信链的句柄.应用程序通过套接字向网络发出请求或应答网络请求. 服 ...

  4. C# 3.0 / C# 3.5 扩展方法

    概述 扩展方法是一种特殊的静态方法,可以像扩展类型上的实例方法一样进行调用,能向现有类型“添加”方法,而无须创建新的派生类型.重新编译或以其他方式修改原始类型. 扩展方法的定义实现: public s ...

  5. Git clone 常见用法

    二 克隆Git仓库     1.1 从远程仓库中克隆整个代码仓库 mkdir Demo //在当前路径下新建一个文件夹,用来存放将要拉取的整个代码库 cd Demo           //进入这个文 ...

  6. 2015-09-22 css2

    6.块元素和行内元素 1. 块元素特点:默认显示在父标签的左上角 块级元素默认占满一行(占满整个文档流) 常见的块元素:p,h1--h6,ul li, ol li,div,hr,table. 2.行内 ...

  7. 把旧系统迁移到.Net Core 2.0 日记(11) -- Authentication 认证 claimsIdentity 对比 之前的FormAuthentication

    实现最简单的认证,类似之前的FormAuthentication 在 Startup 的 ConfigureServices() 方法中添加 Authentication 的配置: 这个CookieA ...

  8. spring boot cloud

    eclipse spring boot 项目创建 https://www.cnblogs.com/shuaihan/p/8027082.html https://www.cnblogs.com/LUA ...

  9. powerdesidgner1

    '******************************************************************************'* File: comment2name ...

  10. China’s movie heroes 《红海行动》展现中国英雄本色

    Recent years have seen a trend for big military movies. Whether it was last year’s British hit Dunki ...