
数学
gtuif
大多数人永远都不会了解真实的你,但是他们会看到你所做的一切。。。
展开
-
ZOJ Problem Set - 4056
Press the ButtonTime Limit: 1 Second Memory Limit: 131072 KBBaoBao and DreamGrid are playing a game using a strange button. This button is attached to an LED light (the light is initially off...原创 2018-10-26 19:50:03 · 211 阅读 · 0 评论 -
E - Buggy Robot
Ivan has a robot which is situated on an infinite grid. Initially the robot is standing in the starting cell (0, 0). The robot can process commands. There are four types of commands it can perform: ...原创 2018-02-26 22:02:40 · 283 阅读 · 0 评论 -
codeforce 777c Alyona and Spreadsheet
During the lesson small girl Alyona works with one famous spreadsheet computer program and learns how to edit tables.Now she has a table filled with integers. The table consists ofn rows and m col原创 2017-12-03 09:03:18 · 282 阅读 · 0 评论 -
HPU 1192
Welcome To HPU Online Judge!1192: Sequence [组合数学]时间限制: 3 Sec 内存限制: 128 MB提交: 160 解决: 62 题目描述在某个夜黑月高的晚上,!!!,原谅我编不下去了。很美吧?放松之后,继续做题吧。HS(Handsome)的Ocean在纸上写下N个整数,Ocean把它定义原创 2017-12-02 16:43:01 · 376 阅读 · 0 评论 -
51nod 1629 B君的圆锥 (数学)
1629 B君的圆锥基准时间限制:1 秒 空间限制:131072 KB 分值: 10难度:2级算法题 收藏 关注B君要用一个表面积为S的圆锥将白山云包起来。B君希望包住的白山云体积尽量大,B君想知道体积最大可以是多少。注意圆锥的表面积包括底面和侧面。Input一行一个整数,表示表面积S。(1 Output原创 2017-12-09 16:18:13 · 198 阅读 · 0 评论 -
Distances to Zero
You are given the array of integer numbers a0, a1, ..., an - 1. For each element find the distance to the nearest zero (to the element which equals to zero). There is at least one zero element in the原创 2017-11-04 17:44:16 · 284 阅读 · 0 评论 -
Maximal GCD
You are given positive integer number n. You should create such strictly increasing sequence ofk positive numbers a1, a2, ..., ak, that their sum is equal ton and greatest common divisor is ma原创 2017-11-04 17:38:29 · 251 阅读 · 0 评论 -
HPU第七周周练 A
Bash has set out on a journey to become the greatest Pokemon master. To get his first Pokemon, he went to Professor Zulu's Lab. Since Bash is Professor Zulu's favourite student, Zulu allows him to tak原创 2017-11-10 23:38:21 · 274 阅读 · 0 评论 -
HPU 1007 严格递增连续子段 [模拟]
1007: 严格递增连续子段 [模拟]时间限制: 1 Sec 内存限制: 128 MB提交: 150 解决: 12 题目描述给定一个有N个正整数组成的序列,你最多可以改变其中一个元素,可以修改为任意的整数。问可以得到的严格递增连续子段的最大长度。输入第一行输入一个整数T,代表有T组测试数据。每组数据占两行,第一行输入一个整数N原创 2017-10-21 10:21:51 · 548 阅读 · 0 评论 -
C - Maximum of Maximums of Minimums
You are given an array a1, a2, ..., an consisting ofn integers, and an integer k. You have to split the array into exactly k non-empty subsegments. You'll then compute the minimum integer on eac原创 2017-10-27 21:08:50 · 601 阅读 · 0 评论 -
codeforce 333B chips
Gerald plays the following game. He has a checkered field of size n × n cells, where m various cells are banned. Before the game, he has to put a few chips on some border (but not corner) board cells...原创 2018-02-25 12:45:54 · 435 阅读 · 0 评论 -
(补题)CF 467 div2
A. Olympiadtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe recent All-Berland Olympiad in Informatics featured n participants with each scoring...原创 2018-03-06 15:43:56 · 322 阅读 · 0 评论 -
51 Nod 1013 3的幂的和
1013 3的幂的和 基准时间限制:1 秒 空间限制:131072 KB 分值: 20 难度:3级算法题 收藏 关注 求:3^0 + 3^1 +...+ 3^(N) mod 1000000007 ...原创 2018-04-10 23:57:58 · 162 阅读 · 0 评论 -
Codeforces Round #516 (Div. 2)
A. Make a triangle!time limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputMasha has three sticks of length aa, bb and cc centimeters re...原创 2018-10-17 18:07:52 · 416 阅读 · 0 评论 -
Codeforces Round #461 (Div. 2) C. Cave Painting
C. Cave Paintingtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputImp is watching a documentary about cave painting.Some number...原创 2018-09-01 09:34:35 · 206 阅读 · 0 评论 -
Codeforces Round #461 (Div. 2) B. Magic Forest
B. Magic Foresttime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputImp is in a magic forest, where xorangles grow (wut?)A xorangl...原创 2018-09-01 09:27:11 · 164 阅读 · 0 评论 -
Codeforces Round #461 (Div. 2) A Cloning Toys
A. Cloning Toystime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputImp likes his plush toy a lot.Recently, he found a machine tha...原创 2018-09-01 09:22:51 · 195 阅读 · 0 评论 -
Wannfly挑战赛20 A 染色
链接:https://www.nowcoder.com/acm/contest/133/A来源:牛客网 时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 262144K,其他语言524288K64bit IO Format: %lld题目描述现在有一棵被Samsara-Karma染了k种颜色的树,每种颜色有着不同的价值Applese觉得Samsara-Karma...原创 2018-07-21 08:51:57 · 209 阅读 · 0 评论 -
K 序列求和
链接:https://www.nowcoder.com/acm/contest/124/K来源:牛客网题目描述 定义S(n) = 12 + 22 + … + n2,输出S(n) % 1000000007。 注意:1 < n < 1e18。输入描述:多组输入,输入直到遇到EOF为止;第一行输入一个正整数n。输出描述:输出S(n) % 1000000007的结果。示例1输入复制1...原创 2018-06-23 21:32:01 · 936 阅读 · 0 评论 -
C 有趣的二进制
链接:https://www.nowcoder.com/acm/contest/124/C来源:牛客网题目描述小新在学C语言的时候,邝老师告诉他double类型的数据在表示小数的时候,小数点后的有效位是有限的,但是没有告诉他这是为什么,后来他发现0.1的二进制是一个无限循环小数0.000110011001100110011001100···,如果只取27位小数,再转换成十进制的话就变成了0.099...原创 2018-06-23 21:28:57 · 308 阅读 · 0 评论 -
CSU 1347 Last Digit
The function f(n, k) is defined by f(n, k) = 1k + 2k + 3k +...+ nk. If you know the value of n and k, could you tell us the last digit of f(n, k)? For example, if n is 3 and k is 2, f(n, k...原创 2018-04-13 20:06:57 · 208 阅读 · 0 评论 -
CSU 1271 Brackets Sequence
1271: Brackets Sequence Time Limit: 1 Sec Memory Limit: 128 Mb Submitted: 354 Solved: 175 Description Let us define a regular brackets sequence in the following way: 1. Empt...原创 2018-04-13 19:57:40 · 167 阅读 · 0 评论 -
51 Nod 1315 合法整数集
1315 合法整数集题目来源: TopCoder基准时间限制:1 秒 空间限制:131072 KB 分值: 10 难度:2级算法题收藏关注一个整数集合S是合法的,指S的任意子集subS有Fun(SubS)!=X,其中X是一个固定整数,Fun(A)的定义如下:A为一个整数集合,设A中有n个元素,分别为a0,a1,a2,...,an-1,那么定义:Fun(A)=a0 or a1原创 2017-09-28 21:11:50 · 259 阅读 · 0 评论 -
HDU 2709 Sumsets
SumsetsTime Limit: 6000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3226 Accepted Submission(s): 1288Problem DescriptionFarmer John commanded原创 2017-09-28 20:58:59 · 232 阅读 · 0 评论 -
河南省多校连萌(五) Problem C: 不是防AK题
Problem C: 不是防AK题 Time Limit: 1 Sec Memory Limit: 64 MB Submit: 271 Solve原创 2017-09-10 07:33:38 · 288 阅读 · 0 评论 -
N - Aladdin and the Optimal Invitation LightOJ - 1349
Finally Aladdin reached home, with the great magical lamp. He was happier than ever. As he was a nice boy, he wanted to share the happiness with all people in the town. So, he wanted to invite all peo原创 2017-08-03 22:36:15 · 392 阅读 · 0 评论 -
M - Billiard Balls LightOJ - 1323
You are given a rectangular billiard board, L and W be the length and width of the board respectively. Unlike other billiard boards it doesn't have any pockets. So, the balls move freely in the boar原创 2017-08-02 23:29:57 · 445 阅读 · 0 评论 -
P - Answering Queries LightOJ - 1369
The problem you need to solve here is pretty simple. You are give a function f(A, n), where A is an array of integers andn is the number of elements in the array. f(A, n) is defined as follows:lon原创 2017-08-07 21:38:17 · 263 阅读 · 0 评论 -
谭爷的黑暗沙拉 UESTC - 1401
谭爷有n种不同种类的食材(水果&蔬菜),他想做出一份总重量为k的黑暗沙拉。他想让机智的你告诉他,他能做多少种不同的黑暗沙拉!说明:1.可以重复选择食材,而且不需要选完全部的nn种食材,但是最后总重量必须是kk。2.两份沙拉不同,当且仅当kk重量食材的种类或配比不同。3.每种食材只能选择非负整数的重量加入沙拉。Input 一行,两个正整数n,k;1<=n,k<=25,1<=n,k<=25;Outpu原创 2017-07-23 21:06:58 · 342 阅读 · 0 评论 -
51Nod1596 搬货物(codeforces)
1596 搬货物题目来源: CodeForces基准时间限制:1 秒 空间限制:131072 KB 分值: 10 难度:2级算法题 收藏 关注现在有n个货物,第i个货物的重量是 2wi 。每次搬的时候要求货物重量的总和是一个2的幂。问最少要搬几次能把所有的货物搬完。样例解释:1,1,2作为一组。3,3作为一组。原创 2017-08-07 17:47:15 · 484 阅读 · 0 评论 -
51 Nod 1284 2 3 5 7的倍数(容斥原理)
1284 2 3 5 7的倍数基准时间限制:1 秒 空间限制:131072 KB 分值: 5 难度:1级算法题 收藏 关注给出一个数N,求1至N中,有多少个数不是2 3 5 7的倍数。 例如N = 10,只有1不是2 3 5 7的倍数。Input输入1个数N(1 Output输出不是2 3 5 7的倍数原创 2017-07-31 15:23:02 · 225 阅读 · 0 评论 -
HDU 2180 时钟
时钟Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2186 Accepted Submission(s): 626Problem Description从a点b分到s点t分时针和分针重合多少次?原创 2017-07-20 20:54:32 · 278 阅读 · 0 评论 -
51Nod 1003 阶乘后面0的数量
讲的挺详细的,建议好好看看,结论很简单,主要是过程;问题描述给定参数n(n为正整数),请计算n的阶乘n!末尾所含有“0”的个数。例如,5!=120,其末尾所含有的“0”的个数为1;10!= 3628800,其末尾所含有的“0”的个数为2;20!= 2432902008176640000,其末尾所含有的“0”的个数为4。计算公式这里先给出其计算公式,后面给出推导过程。转载 2017-07-20 11:16:08 · 231 阅读 · 0 评论 -
51Nod 1058 N的阶乘的长度
输入N求N的阶乘的10进制表示的长度。例如6! = 720,长度为3。Input输入N(1 Output输出N的阶乘的长度Input示例6Output示例3题意:…………思路:一开始感觉要用字符串来写,然而并没有写出来…………查了资料才知道用的是斯特林近似,公式为:n!=sqrt((2*PI*n)*(n/e)^n);下原创 2017-06-29 23:44:58 · 203 阅读 · 0 评论 -
O - IP Checking LightOJ - 1354
An IP address is a 32 bit address formatted in the following way a.b.c.d where a, b, c, d are integers each ranging from 0 to 255. Now you are given two IP addresses, first one in decima原创 2017-08-03 22:43:39 · 274 阅读 · 0 评论 -
LIGHT OJ 1010 Knights in Chessboard
Given an m x n chessboard where you want to place chess knights. You have to find the number of maximum knights that can be placed in the chessboard such that no two knights attack each other.Those原创 2017-05-13 09:43:43 · 209 阅读 · 0 评论 -
1410: QAQ & 火星情报局 [数学]
1410: QAQ & 火星情报局 [数学]时间限制: 1 Sec 内存限制: 128 MB提交: 309 解决: 61 统计题目描述QAQ~超级喜欢看火星情报局,每周六都是他一周中最期待的一天,QAQ喜欢和自己一样心愿是“世界和平”的薛之谦,喜欢“一言不合就飙车”的宇哥,喜欢“再扯的提案都能升华为鸡汤”的汪涵局长....当然也喜欢的里面各种各样奇葩有趣的提原创 2017-08-12 18:06:25 · 567 阅读 · 1 评论 -
河南省多校连萌(五) Problem B: 就是签到题XD
Submit: 545 Solved: 85SubmitWeb BoardDescriptionIn mathematics, we suppose that f(1)=1, f(i)-f(i-1)=1/i, (2InputInput starts with an integer T (≤ 10000), denoting the number of test cas原创 2017-09-10 07:02:22 · 248 阅读 · 0 评论 -
51nod 1119 机器人走方格 V2
组合数学组合数修改 隐藏话题1119 机器人走方格 V2基准时间限制:1 秒 空间限制:131072 KB 分值: 10 难度:2级算法题收藏关注M * N的方格,一个机器人从左上走到右下,只能向右或向下走。有多少种不同的走法?由于方法数量可能很大,只需要输出Mod 10^9 + 7的结果。Input第1行,2个数M,N,中间用空格隔开。(2 Out原创 2017-09-23 14:50:53 · 227 阅读 · 0 评论 -
51Nod1062 序列中最大的数
1062 序列中最大的数题目来源: Ural 1079基准时间限制:1 秒 空间限制:131072 KB 分值: 10 难度:2级算法题收藏关注有这样一个序列a:a[0] = 0a[1] = 1a[2i] = a[i]a[2i+1] = a[i] + a[i+1]输入一个数N,求a[0] - a[n]中最大的数。a[0] = 0, a[1] = 1,原创 2017-09-06 23:03:12 · 254 阅读 · 0 评论