893B Beautiful Divisors

思路:

打表

代码:

#include <bits/stdc++.h>
using namespace std;
#define _for(i,a,b) for(int i=(a); i<(b); ++i)
#define _rep(i,a,b) for(int i=(a); i<=(b); ++i)
int a[8]={1,6,28,120,496,2016,8128,32640};
int main() {
int n;
scanf("%d",&n);
for(int i=7; i>=0; --i) {
if(n%a[i]==0) {
printf("%d\n", a[i]);
return 0;
}
}
return 0;
}

codeforces 893B Beautiful Divisors 打表的更多相关文章

  1. 893B. Beautiful Divisors#美丽的因子(打表法)

    题目出处:http://codeforces.com/problemset/problem/893/B 题目大意:找到一个数在二进制下,最大的以k个连续的1和k-1个连续的0组成的数字作为因子 #in ...

  2. Educational Codeforces Round 33 (Rated for Div. 2) B. Beautiful Divisors【进制思维/打表】

    B. Beautiful Divisors time limit per test 2 seconds memory limit per test 256 megabytes input standa ...

  3. Codeforces 55D Beautiful Number

    Codeforces 55D Beautiful Number a positive integer number is beautiful if and only if it is divisibl ...

  4. CodeForces 55D "Beautiful numbers"(数位DP+离散化处理)

    传送门 参考资料: [1]:CodeForces 55D Beautiful numbers(数位dp&&离散化) 我的理解: 起初,我先定义一个三维数组 dp[ i ][ j ][ ...

  5. Codeforces 55D. Beautiful numbers(数位DP,离散化)

    Codeforces 55D. Beautiful numbers 题意 求[L,R]区间内有多少个数满足:该数能被其每一位数字都整除(如12,24,15等). 思路 一开始以为是数位DP的水题,觉得 ...

  6. 【Educational Codeforces Round 33 B】Beautiful Divisors

    [链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 把所有的那些数字打表出来. 逆序枚举就好 [代码] /* 1.Shoud it use long long ? 2.Have you ...

  7. Codeforces 1264F - Beautiful Fibonacci Problem(猜结论+找性质)

    Codeforces 题面传送门 & 洛谷题面传送门 一道名副其实(beautiful)的结论题. 首先看到这道设问方式我们可以很自然地想到套用斐波那契数列的恒等式,注意到这里涉及到 \(F_ ...

  8. codeforces 55D - Beautiful numbers(数位DP+离散化)

    D. Beautiful numbers time limit per test 4 seconds memory limit per test 256 megabytes input standar ...

  9. 『NYIST』第八届河南省ACM竞赛训练赛[正式赛一]-CodeForces 237C,素数打表,二分查找

    C. Primes on Interval time limit per test 1 second memory limit per test 256 megabytes input standar ...

随机推荐

  1. clone对象

    在JavaScript中,当对象作为参数传给函数的时候,在函数内部对这个对象的属性进行修改时,函数外部的对象属性也会跟着被修改,而有些时候我们并不想原来的对象数据发生改变,这时候就需要切断对象之间的引 ...

  2. LeetCode 121. Best Time to Buy and Sell Stock (买卖股票的最好时机)

    Say you have an array for which the ith element is the price of a given stock on day i. If you were ...

  3. Kotlin——最详解的类(class)的使用

    在任何一门面向对象编程的语言里,类(class)是非常基础.但也是非常重要的一项组成,通俗的说就是万般皆对象,而所说的对象就是我们生成的类.Kotlin也是如此,下面详细为大家介绍Kotlin中的类的 ...

  4. 06-从零玩转JavaWeb-数组在内存当中的存放形式

    一.JVM的内存划分 想要了解数组的内存存储,先要了解JVM的整体内存划分,详细参见第04JVM内存详解 二.数组在JVM当中的存储详解  假如我们有如下代码: 上面代码当中,创建数组的过程我们可以把 ...

  5. Java基础笔记9

    super关键字 表示父类对象. 1.可以调用父类中被重写的方法. 2.还有调用父类中的构造方法.放在子类构造方法的第一行. 不能和this关键字同时出现. final关键字 1.修饰属性.表示常量. ...

  6. JSON.stringify实战用法

    1.首先定义一个数组 var teamPlanMinList = new Array(); 2. 定义一个json对象 var json = { "plname":plname, ...

  7. 最新数据库排行,Oracle略显疲惫

    9月份TOPDB Top Database Index排行榜出炉,TOPDB Top Database Index是根据数据库在谷歌上的搜索频率分析得出的,数据库被搜索的频率越大,表示数 9月份的TO ...

  8. ajax+php(环境搭建+测试)

    在学习JavaScript,jQuery的ajax部分的时候,一直不明白要如何进行,不知道服务器要怎么弄,什么都不知道,当初在学ajax的时候,除了看一下ajax的内容,实践极少,因为,不知道要怎么做 ...

  9. ASP.NET Core 2.0 集成测试无法执行的问题

    问题表现: Microsoft.AspNetCore.Mvc.Razor.Compilation.CompilationFailedException : One or more compilatio ...

  10. MS-SQL 错误: The offset specified in a OFFSET clause may not be negative

    Example 1 : (Fetch clause must be greater than zero) USE AdventureWorks2012 GO SELECT * FROM [HumanR ...