水题,暴力可解。

#include <iostream>

using namespace std;

int chg(int n, int base);

int main() {

    int i;
int tmp; for (i=; i<; i++) {
tmp = chg(i, );
if ( tmp == chg(i, ) && tmp == chg(i, ) )
cout <<i<<endl;
}
} int chg(int n, int base) {
int sum = ; while (n > ) {
sum += n % base;
n = n / base;
} return sum;
}

【HDOJ】1197 Specialized Four-Digit Numbers的更多相关文章

  1. 【LeetCode】201. Bitwise AND of Numbers Range 解题报告(Python)

    [LeetCode]201. Bitwise AND of Numbers Range 解题报告(Python) 标签: LeetCode 题目地址:https://leetcode.com/prob ...

  2. 【LeetCode】633. Sum of Square Numbers

    Difficulty: Easy  More:[目录]LeetCode Java实现 Description https://leetcode.com/problems/sum-of-square-n ...

  3. 【HDOJ】1058 Humble Numbers

    简单题,注意打表,以及输出格式.这里使用了可变参数. #include <stdio.h> #define MAXNUM 5845 #define ANS 2000000000 int b ...

  4. 【HDOJ】1061 Rightmost Digit

    这道题目可以手工打表,也可以机器打表,千万不能暴力解,会TLE. #include <stdio.h> #define MAXNUM 1000000001 ][]; int main() ...

  5. 【HDOJ】1597 find the nth digit

    二分. #include <stdio.h> #include <math.h> int main() { int case_n; double n, tmp, l, r; i ...

  6. 【LeetCode】2、Add Two Numbers

    题目等级:Medium 题目描述:   You are given two non-empty linked lists representing two non-negative integers. ...

  7. 【HDOJ】4729 An Easy Problem for Elfness

    其实是求树上的路径间的数据第K大的题目.果断主席树 + LCA.初始流量是这条路径上的最小值.若a<=b,显然直接为s->t建立pipe可以使流量最优:否则,对[0, 10**4]二分得到 ...

  8. 【LeetCode】233. Number of Digit One

    题目: Given an integer n, count the total number of digit 1 appearing in all non-negative integers les ...

  9. 【leetcode】Sum Root to Leaf Numbers(hard)

    Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number ...

随机推荐

  1. (九)Hibernate 检索策略

    所有项目导入对应的hibernate的jar包.mysql的jar包和添加每次都需要用到的HibernateUtil.java 这里的hibernate.cfg.xml配置信息我就不再写了 第一节:检 ...

  2. iOS NSMutableArray替换某个元素

    A * a1 = [A new]; A * a2 = [A new]; A * a3 = [A new]; A * a4 = [A new]; NSMutableArray *arr = [[NSMu ...

  3. Java多线程同步代码块

    /*多线程的安全问题1.为什么会出现安全问题?因为程序在运行时,会出现一个线程在判断条件满足后,具备了执行资格,但没有运行代码后一个线程也判断了条件,也具备了执行资格,后一个线程运行了代码,但这时候, ...

  4. vbscript multiple line syntax

    Vbscript 如何将输出内容换行? ' VbCrLf represetns Carriage return–linefeed combination, for more information s ...

  5. 文件服务——Vsftpd

    文件传输协议(FTP): 能够让用户在互联网中上传.下载文件的文件协议,FTP服务就是支持FTP传输协议的主机,要想完成文件传输则需要FTP服务端和FTP客户端的配合才行. 通常用户使用FTP客户端软 ...

  6. libipq —— iptables用户空间数据包排队库

    LIBIPQ(3) NAMElibipq —— iptables用户空间数据包排队库 SYNOPSIS #include <linux/netfilter.h>#include <l ...

  7. python制作安装包(setup.py)

    1.制作setup.py from distutils.core import setup setup(name='Myblog', version='1.0', description='My Bl ...

  8. wpf单实例运行

    默认情况下我们可以打开一个应用程序多个实例,例如你双击一个exe多次.当然有些时候这么做会带来很多好处,但是有时我们又不希望这么做,要避免这个问题其实很简单,同WinForm中单实例运行一个应用是一样 ...

  9. mvc razor页面的邮箱校验

    由于@符号是razor中的关键字,而邮箱校验的正则表达式中需要使用@符号,所以在cshtml页面的代码中直接写js代码进行邮箱校验会报错. 解决方案: 将邮箱校验写在js文件中,在cshtml文件中引 ...

  10. 开发设计模式(二) ActiveObject模式

    ActiveObject模式: ActiveObject模式和Command模式的配合使用是实现多线程控制的一项古老的技术,该模式有多种使用方式,为许多工业系统提供了一个简单的多任务核心. // 活动 ...