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. iOS动画学习 -隐式动画

    事务 Core Animation基于一个假设,说屏幕上的任何东西都可以(或者可能)做动画.你并不需要在Core Animation中手动打开动画,但是你需要明确地关闭它,否则它会一直存在. 当你改变 ...

  2. Ionic3 创建应用后,目录结构

    ionic start myApp blank (空项目) hooks --编译cordova时自定义的脚本命令,方便整合到我们的编译系统和版本控制系统中 node_modules --node各类依 ...

  3. John

    John Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others) Total Submissi ...

  4. JAVANIO通道

    package com.nio.test; import java.io.FileInputStream; import java.io.FileNotFoundException; import j ...

  5. Python基础-变量定义-输出输入

    一.变量的定义 字母.数字.下划线组成,不能以数字开头,同时区分大小写 二.输出 print() print(,) 输出空格 input() 读取键盘输入

  6. 【前端】跨浏览器事件处理程序EventUtil.js个人注释及详解

    <javascript高级程序设计>跨浏览器事件处理程序EventUtil.js个人注释 EventUtil.js // 跨浏览器事件处理程序封装 var EventUtil = { // ...

  7. PLSQL锁表之后改如何操作

    (1)查看哪个表被锁select b.owner,b.object_name,a.session_id,a.locked_mode from v$locked_object a,dba_objects ...

  8. 利用C#转换图片格式及转换为ico

    注意:转换为ICO后效果不好. 源代码: using System;using System.Collections.Generic;using System.Text;using System.Dr ...

  9. [转载] java多线程学习-java.util.concurrent详解(四) BlockingQueue

    转载自http://janeky.iteye.com/blog/770671 ------------------------------------------------------------- ...

  10. link和import导入外部样式的区别

    1.结构 link语法结构 <link rel="stylesheet" href="CSSurl" type="text/css" ...