一道水题,只要会复制粘贴就好!

 #include <iostream>
#include <cstring>
#include <cstdlib>
#include <numeric>
#include <cstdio>
#include <algorithm>
#include <cctype>
#include <cmath>
#include <climits>
#include <vector> #define PI acos(-1)
using namespace std; int Judge_Ten (int i) {
int res = ;
while (i) {
res += i % ;
i /= ;
}
return res;
} int Judge_Hex (int i) {
int res = ;
while (i) {
res += i % ;
i /= ;
}
return res;
} int Judge_Twe (int i) {
int res = ;
while (i) {
res += i % ;
i /= ;
}
return res;
} bool Judge (int i) {
if (Judge_Hex(i) == Judge_Twe(i) && Judge_Ten(i) == Judge_Twe(i)) {
return true;
}
return false;
} int main () {
//cout << Judge_Ten (2992) << endl;
//cout << Judge_Twe (2992) << endl;
//cout << Judge_Hex (2992) << endl;
//freopen ("out.txt", "w", stdout);
for (int i = ; i < ; ++ i) {
if (Judge (i)) {
cout << i << endl;
} else {
continue;
}
}
return ;
}

【POJ2196】Specialized Four-Digit Numbers(暴力打表)的更多相关文章

  1. codeforces 9 div2 C.Hexadecimal's Numbers 暴力打表

    C. Hexadecimal's Numbers time limit per test 1 second memory limit per test 64 megabytes input stand ...

  2. HNUSTOJ-1565 Vampire Numbers(暴力打表)

    1565: Vampire Numbers 时间限制: 3 Sec  内存限制: 128 MB提交: 20  解决: 9[提交][状态][讨论版] 题目描述 The number 1827 is an ...

  3. XTU OJ 1210 Happy Number (暴力+打表)

    Problem Description Recently, Mr. Xie learn the concept of happy number. A happy number is a number ...

  4. HDU 1216 Assistance Required(暴力打表)

    传送门: http://acm.hdu.edu.cn/showproblem.php?pid=1216 Assistance Required Time Limit: 2000/1000 MS (Ja ...

  5. ACM/ICPC 之 暴力打表(求解欧拉回路)-编码(POJ1780)

    ///找到一个数字序列包含所有n位数(连续)一次且仅一次 ///暴力打表 ///Time:141Ms Memory:2260K #include<iostream> #include< ...

  6. 【ZOJ】3785 What day is that day? ——浅谈KMP在ACM竞赛中的暴力打表找规律中的应用

    转载请声明出处:http://www.cnblogs.com/kevince/p/3887827.html    ——By Kevince 首先声明一下,这里的规律指的是循环,即找到最小循环周期. 这 ...

  7. HDU 1012 u Calculate e【暴力打表,水】

    u Calculate e Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Tot ...

  8. Codeforces 914 C 数位DP+暴力打表+思维

    题意 给出一个二进制数\(n\),每次操作可以将一个整数\(x\)简化为\(x\)的二进制表示中\(1\)的个数,如果一个数简化为\(1\)所需的最小次数为\(k\),将这个数叫做特殊的数, 问从\( ...

  9. Friends number NBUT - 1223 (暴力打表)

    Paula and Tai are couple. There are many stories between them. The day Paula left by airplane, Tai s ...

  10. 暴力打表之hdu 2089

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2089 有两种方法: 1.数位DP算法 2.暴力打表——真是个好法子!!! 接下来是注意点: 1.一般这 ...

随机推荐

  1. 原生javascript 改写的tab选项卡

    <!--css部分--> <style> *{ margin: 0; padding: 0; } ul,li{ list-style: none } .tabbox{ widt ...

  2. hcharts

    折线图 http://www.hcharts.cn/demo/index.php?p=10 饼状图 http://higrid.net/docs/highcharts_cn/#plotOptions- ...

  3. Android Studio使用技巧系列教程(二)

    尊重劳动成果,转载请注明出处:http://blog.csdn.net/growth58/article/details/46764575 关注新浪微博:@于卫国 邮箱:yuweiguocn@gmai ...

  4. spring+hibernate整合:报错org.hibernate.HibernateException: No Session found for current thread

    spring+hibernate整合:报错信息如下 org.hibernate.HibernateException: No Session found for current thread at o ...

  5. Chapter 4: Spring and AOP:Spring's AOP Framework -- draft

    Spring's AOP Framework Let's begin by looking at Spring's own AOP framework - a proxy-based framewor ...

  6. eclipse注释模板修改

    http://swiftlet.net/archives/1199 以下为模板文件 <?xml version="1.0" encoding="UTF-8" ...

  7. 如何给你的Android 安装文件(APK)瘦身

    如何给你的Android 安装文件(APK)瘦身 本文翻译自:Putting Your APKs on Diet           原作者:Cyril Mottier Android的apk文件越来 ...

  8. Hacker(25)----病毒攻防之认识病毒

    Internet中,计算机病毒是威胁计算机安全的程序.对于计算机病毒,用户不仅需要掌握其基础知识,还要认识常见的病毒及简单病毒制作方法.无论病毒基础还是制作简单病毒,用户需要掌握防御病毒的有效措施和专 ...

  9. ASP.NET中在线用户统计

    统计在线用户的作用不言而喻,就是为了网站管理者可以知道当前用户的多少,然后根据用户数量来观察服务器或者程序的性能,从而可以直观的了解到网站的吸引力或者网站程序的效率.现在,我们就介绍一个简单明了的方法 ...

  10. EF数据存贮问题二之“无法定义这两个对象之间的关系,因为它们附加到不同的 ObjectContext 对象”

    “无法定义这两个对象之间的关系,因为它们附加到不同的 ObjectContext 对象”,这是在EF中,一对多关系表,有外键的类保存至数据库中出现的错误. 我原来是用JAVA开发的,习惯性的处理一对多 ...