数学
文章平均质量分 60
贾作真时真亦贾
吾日三省吾身
展开
-
NYOJ 1081 摆方格
描述 给你一个n*n的方格,每个方格里的数必须连续摆放如 ,下图为不连续的,请输出从左上角到右下角的对角线上的最大和 输入 输入包含多组测试数据。 每一行包括一个数据n,表示n*n的方格(保证所有数据在2^64范围内且n>0) 输出 每行输出占一行,输出最大的对角线之和。 样例输入 1 2 3 样例输出 1原创 2017-07-30 10:25:10 · 218 阅读 · 0 评论 -
1443: [蓝桥杯][历届试题]数字游戏
题目描述 栋栋正在和同学们玩一个数字游戏。 游戏的规则是这样的:栋栋和同学们一共n个人围坐在一圈。栋栋首先说出数字1。接下来,坐在栋栋左手边的同学要说下一个数字2。再下面的一个同学要从上一个同学说的数字往下数两个数说出来,也就是说4。下一个同学要往下数三个数,说7。依次类推。 为了使数字不至于太大,栋栋和同学们约定,当在心中数到 k-1 时,下一个数字从0开始数。例如,当k=13时,栋栋...原创 2018-12-02 20:34:06 · 310 阅读 · 1 评论 -
HDU 多校 Everything Has Changed
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6354 题意:用一堆圆来切割一个圆心为原点,半径为R的圆A,问切割完毕后圆A外围剩余部分的周长(图中的红线部分)。 #include<iostream> #include<cstdio> #include<cmath> #define PI aco...原创 2018-08-10 10:16:27 · 207 阅读 · 0 评论 -
HDU 多校3 Problem D. Euler Function
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6322 题目大意:给定 k,求第 k 小的数 n,满足 φ(n) 是合数。显然 φ(1) = 1 不是合数,只考虑 n ≥ 2 的情况。 思路:得到题意之后,查到了一张表(https://en.wikipedia.org/wiki/Euler%27s_totient_function) 得知当且仅当...原创 2018-07-31 09:22:35 · 152 阅读 · 0 评论 -
HDU 1021 Fibonacci Again
Problem DescriptionThere are another kind of Fibonacci numbers: F(0) = 7, F(1) = 11, F(n) = F(n-1) + F(n-2) (n>=2). InputInput consists of a sequence of lines, each containing an integer n. (n <...原创 2018-03-18 19:25:30 · 114 阅读 · 0 评论 -
HDU 1719 Friend
Problem Description Friend number are defined recursively as follows. (1) numbers 1 and 2 are friend number; (2) if a and b are friend numbers, so is ab+a+b; (3) only the numbers defined in (1)原创 2017-11-19 19:32:36 · 232 阅读 · 0 评论 -
HDU 6152 Friend-Graph
Problem Description It is well known that small groups are not conducive of the development of a team. Therefore, there shouldn’t be any small groups in a good team. In a team with n members,if the原创 2017-08-20 11:30:04 · 175 阅读 · 0 评论 -
HDU 6130 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 sequence consists of 1 and 2, and its first term equals 1. Besides, if you see adjacent and equal term原创 2017-08-20 11:16:12 · 649 阅读 · 0 评论 -
HDU 6124 Euler theorem
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 dif原创 2017-08-20 10:53:04 · 242 阅读 · 0 评论 -
HDU 6106 Classes
Problem Description The school set up three elective courses, assuming that these courses are A, B, C. N classes of students enrolled in these courses. Now the school wants to count the number of s原创 2017-08-19 11:04:26 · 212 阅读 · 0 评论 -
HDU 2017 多校联赛 1011 KazaQ's Socks
Problem Description KazaQ wears socks everyday. At the beginning, he has n pairs of socks numbered from 1 to n in his closets. Every morning, he puts on a pair of socks which has the smallest numbe原创 2017-07-25 19:34:15 · 384 阅读 · 0 评论 -
HDU 2017 多校联赛 1001 Add More Zero
Problem Description There is a youngster known for amateur propositions concerning several mathematical hard problems. Nowadays, he is preparing a thought-provoking problem on a specific type of sup原创 2017-07-25 19:03:22 · 344 阅读 · 0 评论 -
HDU 1465 不容易系列之一
Problem Description 大家常常感慨,要做好一件事情真的不容易,确实,失败比成功容易多了! 做好“一件”事情尚且不易,若想永远成功而总从不失败,那更是难上加难了,就像花钱总是比挣钱容易的道理一样。 话虽这样说,我还是要告诉大家,要想失败到一定程度也是不容易的。比如,我高中的时候,就有一个神奇的女生,在英语考试的时候,竟然把40个单项选择题全部做错了!大家都学过概率论,应该原创 2017-07-24 19:40:55 · 244 阅读 · 0 评论 -
NYOJ 1103 区域赛系列一多边形划分
描述 Give you a convex(凸边形), diagonal n-3 disjoint divided into n-2 triangles(直线), for different number of methods, such as n=5, there are 5 kinds of partition method, as shown in Figure 输入 T原创 2017-07-30 10:44:03 · 202 阅读 · 0 评论 -
HDU 1999 不可摸数
Problem Description s(n)是正整数n的真因子之和,即小于n且整除n的因子和.例如s(12)=1+2+3+4+6=16.如果任何 数m,s(m)都不等于n,则称n为不可摸数. Input 包含多组数据,首先输入T,表示有T组数据.每组数据1行给出n(2<=n<=1000)是整数。 Output ...原创 2018-12-11 19:37:15 · 142 阅读 · 0 评论