思维题
昨日明眸
个人爱好
展开
-
Parallelogram Counting(求平行四边形个数)
Parallelogram CountingTime Limit: 5000MSMemory Limit: 65536KTotal Submissions: 5605Accepted: 1885DescriptionThere are n distinct points in the plane, gi原创 2016-08-13 17:22:34 · 781 阅读 · 0 评论 -
codeforces 501C Misha and Forest(找边)
Misha and Foresttime limit per test 1 secondmemory limit per test 256 megabytesinput standard inputoutput standard outputLet's define a forest as a non-directed原创 2016-09-28 16:17:04 · 190 阅读 · 0 评论 -
CodeForces 337C Quiz(1等比数列找规律)
QuizTime Limit:1000MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64uSubmit Status Practice CodeForces 337CAppoint description: System Crawler (Oct 22, 2016 3:24:05 PM)jeh原创 2016-10-22 19:47:13 · 373 阅读 · 0 评论 -
Codeforces #369(Div.2)B.Chris and Magic Square(矩阵找数)
B. Chris and Magic Squaretime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputZS the Coder and Chris the Baboon原创 2016-09-08 20:20:02 · 201 阅读 · 0 评论 -
Lightoj 1307 Counting Triangles
题意:给你n个木条,问有多少种方案组成三角形、题解:将所有木条排序,因为三角形两边之和大于第三边,找出小于两边之和的木条#include "cstdio" #include "algorithm" using namespace std; int a[10100]; int main() { int n, caseno = 0, cases;原创 2016-09-24 13:33:05 · 261 阅读 · 0 评论 -
LightOJ 1189 - Sum of Factorials
DescriptionGiven an integer n, you have to find whether it can be expressed as summation of factorials. For given n, you have to report a solution such thatn = x1! + x2! + ... + xn! (xi Inpu原创 2016-09-24 13:25:41 · 235 阅读 · 0 评论 -
light oj(简化复杂度)
DescriptionGiven a code (not optimized), and necessary inputs, you have to find the output of the code for the inputs. The code is as follows:int a, b, c, d, e, f;int fn( int n ) { if( n原创 2016-09-24 13:21:59 · 217 阅读 · 0 评论 -
LightOJ 1225 Palindromic Numbers
DescriptionA palindromic number or numeral palindrome is a 'symmetrical' number like 16461, that remains the same when its digits are reversed. In this problem you will be given an integer, you have原创 2016-09-24 13:16:21 · 193 阅读 · 0 评论 -
LightOJ 1136 Division by 3(取模)
DescriptionThere is sequence 1, 12, 123, 1234, ..., 12345678910, ... . Now you are given two integers A and B, you have to find the number of integers fromAth number to Bth (inclusive) number, w原创 2016-09-24 13:12:43 · 659 阅读 · 0 评论 -
codeforces 486B OR in Matrix(位运算)
OR in MatrixTime Limit:1000MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64uSubmit StatusDescriptionLet's define logical OR as an operation on two logical values (i.原创 2016-10-02 21:16:14 · 325 阅读 · 0 评论 -
Codeforces--368C--Sereja and Algorithm(规律)
Sereja and AlgorithmTime Limit:1000MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64uSubmit StatusDescriptionSereja loves all sorts of algorithms. He has recently com原创 2016-10-07 10:37:33 · 350 阅读 · 0 评论 -
51nod_1024 矩阵中不重复的元素(对数求解·)
1024 矩阵中不重复的元素一个m*n的矩阵。该矩阵的第一列是a^b,(a+1)^b,.....(a + n - 1)^b第二列是a^(b+1),(a+1)^(b+1),.....(a + n - 1)^(b+1).......第m列是a^(b + m - 1),(a+1)^(b + m - 1),.....(a + n - 1)原创 2016-12-18 13:15:19 · 282 阅读 · 0 评论 -
CodeForces 111B(数组模拟,记录因子位置)
Petya and DivisorsTime Limit:5000MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64u:Description描述:Little Petya loves looking for numbers' divisors. One day Petya came across the followin原创 2016-11-20 10:57:00 · 312 阅读 · 0 评论 -
51nod-1009 数字1的数量
1009 数字1的数量基准时间限制:1 秒 空间限制:131072 KB 分值: 5 难度:1级算法给定一个十进制正整数N,写下从1开始,到N的所有正数,计算出其中出现所有1的个数。例如:n = 12,包含了5个1。1,10,12共包含3个1,11包含2个1,总共5个1。Input输入N(1 Output输原创 2016-11-14 20:01:59 · 314 阅读 · 0 评论 -
51nod-1010 只包含因子2 3 5的数
1010 只包含因子2 3 5的数基准时间限制:1 秒 空间限制:131072 KB 分值: 10 难度:2级算法题K的因子中只包含2 3 5。满足条件的前10个数是:2,3,4,5,6,8,9,10,12,15。所有这样的K组成了一个序列S,现在给出一个数n,求S中 >= 给定数的最小的数。例如:n = 13,S中 >= 13的最小的数是15,原创 2016-11-13 20:32:23 · 259 阅读 · 0 评论 -
HDU 1214 圆桌会议
圆桌会议Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 1914 Accepted Submission(s): 1319Problem DescriptionHDU ACM集训队的队员在暑假集训时经常原创 2016-11-13 14:16:29 · 352 阅读 · 0 评论 -
CodeForces 233B Non-square Equation(数学问题方程转化)
Non-square EquationTime Limit:1000MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64uDescription:描述:Let's consider equation: x^2 + s(x)·x - n = 0, where x, n are positi原创 2016-11-13 14:06:29 · 421 阅读 · 0 评论 -
Codeforces 445 A DZY Loves Chessboard(预处理)
DZY Loves ChessboardTime Limit:1000MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64uSubmitStatusDescriptionDZY loves chessboard, and he enjoys playing with it.He has a chessboard原创 2016-10-30 16:44:01 · 357 阅读 · 0 评论 -
CF#215DIV2:B. Sereja and Suffixes(哈希记录)
Sereja and SuffixesTime Limit:1000MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64uSubmit StatusDescriptionSereja has an array a, consisting of n integers a1, a2, ..原创 2016-10-07 10:51:09 · 261 阅读 · 0 评论 -
LightOJ1104---Birthday Paradox (概率)
Sometimes some mathematical results are hard to believe. One of the common problems is the birthday paradox. Suppose you are in a party where there are 23 people including you. What is the probability原创 2016-08-15 08:40:42 · 233 阅读 · 0 评论 -
UVA 10200 Prime Time (打表)(精度太坑了)
UVA 10200 Prime Time (打表)Prime TimeEuler is a well-known matematician, and, among many other things, he discovered that the formula n 2 + n + 41 produces a prime for 0 ≤ n < 40. For n = 40, th原创 2016-08-13 17:15:26 · 448 阅读 · 0 评论 -
Codeforces Round #368 (Div. 2) Bakery
B. Bakerytime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputMasha wants to open her own bakery and bake muffi原创 2016-08-21 13:16:40 · 173 阅读 · 0 评论 -
不是匹配
不是匹配时间限制:1000 ms | 内存限制:65535 KB描述 有N个人,N个活动, 每个人只会对2个或者3个活动感兴趣, 每个活动也只有两个人或者两个活动对它兴趣,每个人参加一个 感兴趣的活动需要一天 ,且当天该活动被参加时,其他的人不能参加 如果每个人都参加完自己有兴趣的活动,应当怎样安排使得所用总天数时间最短2输入原创 2016-08-20 17:07:00 · 239 阅读 · 0 评论 -
Codeforces Round #366 (Div. 2)B
B. Spider Mantime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputPeter Parker wants to play a game with Dr. Oc原创 2016-08-20 16:17:27 · 217 阅读 · 0 评论 -
1031 骨牌覆盖
1031 骨牌覆盖基准时间限制:1 秒 空间限制:131072 KB 分值: 10 难度:2级算法题在2*N的一个长方形方格中,用一个1*2的骨牌排满方格。问有多少种不同的排列方法。例如:2 * 3的方格,共有3种不同的排法。(由于方案的数量巨大,只输出 Mod 10^9 + 7 的结果)Input输入原创 2016-08-18 10:38:09 · 254 阅读 · 0 评论 -
Problem J: 小火山的计算能力
Problem J: 小火山的计算能力Time Limit: 1 Sec Memory Limit: 128 MBSubmit: 437 Solved: 104SubmitStatusWeb BoardDescription别人说小火山的计算能力不行,小火山很生气,于是他想证明自己,现在有一个表达式,他想计算出来。Input首先是一个t(1原创 2016-08-10 18:25:40 · 281 阅读 · 0 评论 -
1240 莫比乌斯函数(数论)
1240 莫比乌斯函数基准时间限制:1 秒 空间限制:131072 KB 分值: 0 难度:基础题莫比乌斯函数,由德国数学家和天文学家莫比乌斯提出。梅滕斯(Mertens)首先使用μ(n)(miu(n))作为莫比乌斯函数的记号。(据说,高斯(Gauss)比莫比乌斯早三十年就曾考虑过这个函数)。具体定义如下:如果一个数包含平方因子,那么miu(n)原创 2016-08-13 09:29:22 · 1256 阅读 · 0 评论 -
Flea travel(别样A+B)
Flea travelTime Limit:2000MS Memory Limit:262144KB 64bit IO Format:%I64d& %I64u SubmitStatus DescriptionCan you imagine our life if we removed all zeros from it? For sure we willha原创 2016-05-15 20:55:19 · 429 阅读 · 0 评论 -
1265 四点共面(向量求解)
1265 四点共面基准时间限制:1 秒 空间限制:131072 KB 分值: 0 难度:基础题给出三维空间上的四个点(点与点的位置均不相同),判断这4个点是否在同一个平面内(4点共线也算共面)。如果共面,输出"Yes",否则输出"No"。Input第1行:一个数T,表示输入的测试数量(1 <= T <= 1000)第2 - 4T原创 2016-08-11 16:23:58 · 970 阅读 · 0 评论 -
NanoApe Loves Sequence(求最大值的期望)
NanoApe Loves Sequence Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 262144/131072 K (Java/Others)问题描述退役狗 NanoApe 滚回去学文化课啦!在数学课上,NanoApe 心痒痒又玩起了数列。他在纸上随便写了一个长度为 nnn 的原创 2016-09-12 19:52:10 · 1085 阅读 · 0 评论 -
CodeForces 632B
B. Alice, Bob, Two Teamstime limit per test1.5 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAlice and Bob are playing a game原创 2016-08-22 19:36:47 · 235 阅读 · 0 评论 -
1264 线段相交(几何计算)
1264 线段相交基准时间限制:1 秒 空间限制:131072 KB 分值: 0 难度:基础题给出平面上两条线段的两个端点,判断这两条线段是否相交(有一个公共点或有部分重合认为相交)。 如果相交,输出"Yes",否则输出"No"。Input第1行:一个数T,表示输入的测试数量(1 第2 - T + 1行:每行8个数,x1,y1,x2,y2,x3,y3,x4,y4。(-10^8原创 2016-08-11 17:35:38 · 222 阅读 · 0 评论 -
Wet Shark and Bishops
Wet Shark and BishopsTime Limit:2000MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64uSubmitStatusDescriptionToday, Wet Shark is given n bishops on a1000 by 1000 grid. Both row原创 2016-05-24 18:33:52 · 355 阅读 · 0 评论 -
HDU1800
Flying to the Mars Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 4318 Accepted Submission(s): 1393原创 2016-05-18 19:11:06 · 338 阅读 · 0 评论 -
田忌赛马
田忌赛马时间限制:3000 ms | 内存限制:65535 KB难度:3描述Here is a famous story in Chinese history."That was about 2300 years ago. General Tian Ji was a high official in the country Qi. He likes to原创 2016-05-18 17:35:47 · 373 阅读 · 0 评论 -
异或运算
异或运算已知一个包含 $n$ 个元素的正整数集合 $S$,设 $f(S)$ 为集合 $S$ 中所有元素的异或(XOR)的结果。 如:$S = \{1, 2, 3\}$, 则 $f(S) = 0$。 给出集合 $S$,你需要计算 将所有 $f(s)$ 进行异或后的值, 这里 $s \subseteq S$.输入描述多组测试数据。第一行包含一个整数 $T(T\leq 20)$ 表示原创 2016-05-16 13:10:42 · 517 阅读 · 0 评论 -
思维测试
Toy ArmyTime Limit:2000MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64uSubmitStatusDescriptionThe hero of our story, Valera, and his best friend Arcady are still in schoo原创 2016-05-16 12:41:41 · 345 阅读 · 0 评论 -
light_oj 1282 求n^k的前几位数和后几位数
light_oj 1282 求n^k的前几位数和后几位数light_oj 1282 求n^k的前几位数和后几位数E - Leading and TrailingTime Limit:2000MS Memory Limit:32768KB 64bit IO Format:%lld & %lluSubmit Status Practice LightOJ转载 2016-08-24 08:48:20 · 251 阅读 · 0 评论 -
CodeForces 660A
A. Co-prime Arraytime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given an array of n elements, you原创 2016-08-22 19:37:56 · 176 阅读 · 0 评论 -
51nod_1305 Pairwise Sum and Divide(数学规律)
1305 Pairwise Sum and Divide题目来源: HackerRank基准时间限制:1 秒 空间限制:131072 KB 分值: 5 难度:1级算法题有这样一段程序,fun会对整数数组A进行求值,其中Floor表示向下取整:fun(A) sum = 0 for i = 1 to A.length原创 2016-12-18 13:22:54 · 261 阅读 · 0 评论