HDU 5430 Reflect】的更多相关文章

题目: http://acm.hdu.edu.cn/showproblem.php?pid=5430 从镜面材质的圆上一点发出一道光线反射NNN次后首次回到起点. 问本质不同的发射的方案数. 输入描述 第一行一个整数T,表示数据组数.T≤10T \leq 10T≤10 对于每一个组,共一行,包含一个整数,表示正整数N(1≤N≤106)N(1 \leq N \leq 10^{6})N(1≤N≤10​6​​). 输出描述 对于每一个组,输出共一行,包含一个整数,表示答案. 输入样例 1 4 输出样例…
题意:问在一个圆形的镜面里,从任意一点发出一个光源,经n次反射回到起点的情况数是多少. 解法:直接贴题解吧…… 求1至N+1中与N+1互质的个数,即欧拉函数. 代码: #include<stdio.h> #include<iostream> #include<algorithm> #include<string> #include<string.h> #include<math.h> #include<limits.h>…
Problem Description We send a light from one point on a mirror material circle,it reflects N times and return the original point firstly.Your task is calcuate the number of schemes. ![](../../data/images/C628--.jpg)   Input First line contains a sing…
Reflect  Accepts: 72  Submissions: 302  Time Limit: 2000/1000 MS (Java/Others)  Memory Limit: 65536/65536 K (Java/Others) 问题描述 从镜面材质的圆上一点发出一道光线反射NN次后首次回到起点. 问本质不同的发射的方案数. 输入描述 第一行一个整数T,表示数据组数.T \leq 10T≤10 对于每一个组,共一行,包含一个整数,表示正整数N(1 \leq N \leq 10^{6…
Reflect Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://bestcoder.hdu.edu.cn/contests/contest_chineseproblem.php?cid=628&pid=1003 Description 从镜面材质的圆上一点发出一道光线反射NN次后首次回到起点. 问本质不同的发射的方案数. Input 第一行一个整数T,表示数据组数.T \leq 20T≤20 对于每一个组,第一行一个整数n(1 \leq n…
题意:求光在圆内反射n次后第一次返回原点的方案数 如果k和n-1可约分,则表明是循环多次反射方案才返回原点. #include <iostream> #include <cstring> #include <cstdio> using namespace std; int gcd(int x,int y) { if(x%y != 0) return gcd(y,x%y); return y; } int main() { int T,n; scanf("%d&…
 Danganronpa(弹丸论破) Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Description 题目描述 Chisa Yukizome works as a teacher in the school. She prepares many gifts, which consist of n kinds with a[i] quantities of each ki…
Danganronpa 题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5835 Description Chisa Yukizome works as a teacher in the school. She prepares many gifts, which consist of n kinds with a[i] quantities of each kind, for her students and wants to hold a cl…
Dying Light Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 513    Accepted Submission(s): 122 Problem Description LsF is visiting a local amusement park with his friends, and a mirror room su…
Information Disturbing Time Limit: 6000/3000 MS (Java/Others)    Memory Limit: 131072/65536 K (Java/Others)Total Submission(s): 3205    Accepted Submission(s): 1137 Problem Description In the battlefield , an effective way to defeat enemies is to bre…