
数学
#
MySGDLife
总分总
展开
-
Codeforces 667div3 D.Decrease the Sum of Digits
You are given a positive integer n. In one move, you can increase n by one (i.e. make n:=n+1). Your task is to find the minimum number of moves you need to perform in order to make the sum of digits of n be less than or equal to s. You have to answer t ind原创 2020-09-08 11:54:53 · 184 阅读 · 0 评论 -
CodeForces 667div3 C.Yet Another Array Restoration
We have a secret array. You don’t know this array and you have to restore it. However, you know some facts about this array: The array consists of n distinct positive (greater than 0) integers. The array contains two elements x and y (these elements are kn原创 2020-09-08 11:49:01 · 305 阅读 · 0 评论 -
Codeforces Round #624 (Div. 3)D. Three Integers
D. Three Integers time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output You are given three integers a≤b≤c. In one move, you can add +1 or −1 to any...原创 2020-03-31 20:49:40 · 194 阅读 · 1 评论 -
HDU 1018 数学
Hang想知道n!有多少位数,因为n比较大的时候,这个数很难表示,因为Hang数学比较菜,所以请你这个天才的ACMer帮忙。 为了让这道题变成一道签到题,Hang给你一个公式 image.png 斯特林公式是用来求n!的近似值,当n越大的时候值越精确 善良的Hang还告诉你了 e=2.718281828 连公式都给了,我就没见过这么好的出题人 Input 第一行one整数t,t组,我也忘了t有多大...原创 2019-08-08 00:52:33 · 144 阅读 · 0 评论 -
勾股定理 数学
来源:牛客网 给出直角三角形其中一条边的长度n,你的任务是构造剩下的两条边,使这三条边能构成一个直角三角形。 输入描述: 一个整数n。 输出描述: 另外两条边b,c。答案不唯一,只要输出任意一组即为合理,如果无法构造请输出-1。 示例1 输入 复制 3 输出 复制 4 5 示例2 输入 复制 4 输出 复制 3 5 备注: 0<=n<=1e9 1<=b,c<=1e18 n,...原创 2019-09-09 00:00:59 · 183 阅读 · 0 评论