
打表
xuanweiace
一个热爱算法竞赛的弱校ACMer路过。青大本,浙大硕,方向后端开发,菜鸡一枚,奋斗ing...
展开
-
小明数(打表)
Description小明比较喜欢研究各种各样的数字,有一天他发现了一类数,并将这些数命名为“小明数”,下面是“小明数”的定义:数字的二进制由连续的k个1和连续的k-1个0组成。比如:1(二进制为:1,k=1)6(二进制为:110,k=2)120(二进制为:1111000,k=4)496(二进制为:111110000,k=5)现在给你一个数字n,求他所有的因子里最大的“小明数”。Input第1行:...原创 2018-06-06 22:08:49 · 707 阅读 · 0 评论 -
【CodeForces - 472A】Design Tutorial: Learn from Math (tricks,思维,数论,打表)
题干:One way to create a task is to learn from math. You can generate some random math statement or modify some theorems to get something new and build a new task from that.For example, there is a s...原创 2019-01-22 00:33:16 · 272 阅读 · 0 评论 -
【牛客 - 280A】勘测(fib数列,思维,打表)
题干:Actci偶然发现了一个矿洞,这个矿洞的结构类似与一棵二叉树,Actci发现的矿洞恰好位于根节点处,为了尽快挖掘,Actci找来了她的小伙伴们来帮忙,由于地质原因,每天小伙伴们只能打通到一条到子节点的道路(不消耗时间),也就是说每天一个节点只能向一个子节点建设道路,走一条路需要一天的时间,当发现一条道路后,会有一部分小伙伴选择留下来继续勘测,假设小伙伴们有无数个,树的深度足够大,问第n天...原创 2018-12-29 21:24:45 · 257 阅读 · 0 评论 -
【CodeForces - 151C】Win or Freeze (博弈,数学,唯一素数分解)
题干:You can't possibly imagine how cold our friends are this winter in Nvodsk! Two of them play the following game to warm up: initially a piece of paper has an integer q. During a move a player shou...原创 2018-11-21 18:54:38 · 525 阅读 · 0 评论 -
【POJ - 3048】Max Factor (数论,打表,水题)
题干:To improve the organization of his farm, Farmer John labels each of his N (1 <= N <= 5,000) cows with a distinct serial number in the range 1..20,000. Unfortunately, he is unaware that the ...原创 2018-11-12 20:25:57 · 650 阅读 · 0 评论 -
【HDU - 2012】素数判定(水题,数论,打表)
题干: 解题报告: AC代码1:#include<bits/stdc++.h>#define MAX 10000//求MAX范围内的素数 using namespace std; long long su[MAX],cnt; bool isprime[MAX]; void prime() { cnt=1; memse...原创 2018-11-12 20:13:39 · 248 阅读 · 0 评论 -
【CodeForces - 271B 】Prime Matrix (素数,预处理打表,思维)
题干:You've got an n × m matrix. The matrix consists of integers. In one move, you can apply a single transformation to the matrix: choose an arbitrary element of the matrix and increase it by 1. Each...原创 2018-11-18 22:03:00 · 317 阅读 · 0 评论 -
【CodeForces - 244B】Undoubtedly Lucky Numbers (dfs打表 + 二分)
题干:Polycarpus loves lucky numbers. Everybody knows that lucky numbers are positive integers, whose decimal representation (without leading zeroes) contain only the lucky digits x and y. For example,...原创 2018-11-08 16:39:18 · 1299 阅读 · 0 评论 -
【51Nod - 1010 】只包含因子2 3 5的数 (打表,有坑越界)
题干:K的因子中只包含2 3 5。满足条件的前10个数是:2,3,4,5,6,8,9,10,12,15。所有这样的K组成了一个序列S,现在给出一个数n,求S中 >= 给定数的最小的数。例如:n = 13,S中 >= 13的最小的数是15,所以输出15。Input第1行:一个数T,表示后面用作输入测试的数的数量。(1 <= T <= 10000) 第2 ...原创 2018-10-17 19:28:22 · 215 阅读 · 0 评论 -
【 HRBUST - 1055】Single(模拟,dp,打表)(总结)
题干:There are many handsome single boys in our team, for example, me. Some times, we like count singles. For example, in the famous “November 11th” (11.11), there are four singles ,so, single is actu...原创 2018-10-05 18:05:10 · 318 阅读 · 0 评论 -
【HDU - 1216 】Assistance Required (模拟,类似素数打表,不是素数问题!)
题干:After the 1997/1998 Southwestern European Regional Contest (which was held in Ulm) a large contest party took place. The organization team invented a special mode of choosing those participants t...原创 2018-09-13 14:26:48 · 253 阅读 · 0 评论 -
【CodeForces - 761C】Dasha and Password (暴力可过,标解dp,字符串,有坑总结)
题干:After overcoming the stairs Dasha came to classes. She needed to write a password to begin her classes. The password is a string of length n which satisfies the following requirements:There is ...原创 2018-09-12 11:17:20 · 519 阅读 · 0 评论 -
【HDU - 5914 】Triangle (打表 或 set维护)
题干:Mr. Frog has n sticks, whose lengths are 1,2, 3⋯⋯n respectively. Wallice is a bad man, so he does not want Mr. Frog to form a triangle with three of the sticks here. He decides to steal some stic...原创 2018-09-05 01:06:37 · 231 阅读 · 0 评论 -
素数环(dfs&&STL做法)HDU - 1016
这题第一思路显然dfs,但是最近想了一下可以用next_permutation做,结果TLE了,究其原因,就是深搜的时候剪枝做的比较好,所以运行的时间一对比(样例是n=18),会发现dfs的解法程序在不停的输出数据,但是STL的却仅仅是在闪光标。 得结论:有的题剪枝的十分优雅(比如这题,如果1 2 判断不成立,那么第二个数放2这一大支直接剪掉了),便不能用next_permutati...原创 2018-06-07 22:22:39 · 264 阅读 · 0 评论 -
【HDU - 5878】I Count Two Three(打表)
题干:I will show you the most popular board game in the Shanghai Ingress Resistance Team.It all started several months ago.We found out the home address of the enlightened agent Icount2three and de...原创 2019-07-06 20:15:34 · 256 阅读 · 0 评论