POJ 2719
#include<iostream>
#include<stdio.h>
using namespace std;
int dight[];
int _pow(int m,int n);
int main(){
//freopen("test.txt","r",stdin);
int i;
int num;
dight[] = ;
dight[] = ;
for(i = ; i < ; i++)
{
dight[i] = _pow(,i-) + dight[i-] + *dight[i-];
}
while(cin>>num){
if(num == )
break;
int j;
int k = ;
int temp;
temp = num;
int sum = ;
while(temp)
{
j = temp%;
temp /= ;
if(j > )
{
sum += _pow(,k);
sum += dight[k]*(j-);
}
else
sum += dight[k]*j;
k++;
}
cout<<num<<": "<<num-sum<<endl;
}
system("pause");
}
int _pow(int m,int n)
{
if(n == )
return ;
else if( == n)
return m;
else
return m*_pow(m,n-);
}
POJ 2719的更多相关文章
- poj 2719 Faulty Odometer
Description You are given a car odometer which displays the miles traveled as an integer. The odomet ...
- 2719:陶陶摘苹果-poj
2719:陶陶摘苹果 总时间限制: 1000ms 内存限制: 65536kB 描述 陶陶家的院子里有一棵苹果树,每到秋天树上就会结出10个苹果.苹果成熟的时候,陶陶就会跑去摘苹果.陶陶有个30厘米 ...
- poj 3373 Changing Digits (DFS + 记忆化剪枝+鸽巢原理思想)
http://poj.org/problem?id=3373 Changing Digits Time Limit: 3000MS Memory Limit: 65536K Total Submi ...
- poj和hdu部分基础算法分类及难度排序
最近想从头开始刷点基础些的题,正好有个网站有关于各大oj的题目分类(http://www.pythontip.com/acm/problemCategory),所以写了点脚本把hdu和poj的一些题目 ...
- POJ 3370. Halloween treats 抽屉原理 / 鸽巢原理
Halloween treats Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 7644 Accepted: 2798 ...
- POJ 2356. Find a multiple 抽屉原理 / 鸽巢原理
Find a multiple Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 7192 Accepted: 3138 ...
- POJ 2965. The Pilots Brothers' refrigerator 枚举or爆搜or分治
The Pilots Brothers' refrigerator Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 22286 ...
- POJ 1753. Flip Game 枚举or爆搜+位压缩,或者高斯消元法
Flip Game Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 37427 Accepted: 16288 Descr ...
- POJ 3254. Corn Fields 状态压缩DP (入门级)
Corn Fields Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 9806 Accepted: 5185 Descr ...
随机推荐
- 2018.10.30 NOIP模拟 有环无向图(dijkstra+巧妙建图)
传送门 建图巧妙啊. 对于每个点的出边,我们将它们排序之后依次连边. 这样可以把O(m2)O(m^2)O(m2)的边数变成O(m)O(m)O(m)的了. 连的权值就是max(edgemax(edgem ...
- Codeforces Round #523 (Div. 2) F. Katya and Segments Sets (交互题+思维)
https://codeforces.com/contest/1061/problem/F 题意 假设存在一颗完全k叉树(n<=1e5),允许你进行最多(n*60)次询问,然后输出这棵树的根,每 ...
- 2.2.11同步synchronized方法无限等待与解决
同步方法容易造成死循环. package com.cky.bean; /** * Created by edison on 2017/12/8. */ public class Service { s ...
- oracle 监听文件 说明
MAR:电脑笔记 不做整理 .. ORACLE_SID=orcl2 instance_name=sicca 静态注册文件中SID_NAME=ORACLE_SID 动态注册的时候是用的instance_ ...
- (转)Eclipse开发Web项目
1. 建立最简单的JSP和servlet http://wenku.baidu.com/link?url=bcf8iwB3E5_gjl46WfZAekQUWsps0-G3MAbbKz5totQcvmS ...
- 《ARM Cortex-M3权威指南》笔记(1)
http://blog.csdn.net/roverx/article/details/6624859 第1章 介绍 一.ARM Cortex‐M3处理器初探 CM3处理器内核是单片机的中央处理单元( ...
- 关于git的ssh permission denied原因汇总
SSH关于公钥认证Permission denied (publickey,gssapi-with-mic的问题 http://h2appy.blog.51cto.com/609721/1112797 ...
- 用jquery制作一个二级导航下拉菜单
1使用$(function(){...})获取到想要作用的HTML元素. 2通过使用children()方法寻找子元素. 3通过使用show()方法来显示HTML元素. 4通过 ...
- PAT甲级 1125. Chain the Ropes (25)
1125. Chain the Ropes (25) 时间限制 200 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue Given ...
- 跟哥走,带你玩转Surface 2
以为自己是数码控?觉得自己买了Surface就无所不能?别逗了!来看哥怎么玩平板,也让你们这些小虾米看看,什么才叫“玩转”! 新技能Get:密码不在用键盘 什么?每次开机你还要输入一长串密码?都什么年 ...