POJ 1316】的更多相关文章

1.链接地址: http://poj.org/problem?id=1316 http://bailian.openjudge.cn/practice/1316 2.题目: 总时间限制: 1000ms 内存限制: 65536kB 描述 In 1949 the Indian mathematician D.R. Kaprekar discovered a class of numbers called self-numbers. For any positive integer n, define…
[题目链接] https://www.lydsy.com/JudgeOnline/problem.php?id=1316 [算法] 点分治 由于边权较大,笔者在计算时使用了STL-set 注意当询问为0时,要输出"Yes" [代码] #include<bits/stdc++.h> using namespace std; #define MAXN 10010 #define MAXQ 110 struct Edge { int to,w,nxt; } e[MAXN<&…
#include<iostream> using namespace std; #define NUM 10000 int main(){ }; int i; ; int j; ;i<NUM;i++){ ') continue; j=i; while(j<NUM){ sum=j; ){ sum+=j%; j/=; } if(sum<NUM) num[sum]='; j=sum; } } ;i<NUM;i++){ ') printf("%d\n",i)…
一.Description In 1949 the Indian mathematician D.R. Kaprekar discovered a class of numbers called self-numbers. For any positive integer n, define d(n) to be n plus the sum of the digits of n. (The d stands for digitadition, a term coined by Kaprekar…
POJ在评阅习题时需要向程序提供输入数据,并获取程序的输出结果.因此提交的程序需按照每个习题具体的输入输出格式要求处理输入输出.有的时候,测评系统给出程序的评判结果是“数据错误”或“结果错误”,有可能就与没有正确使用输入输出格式有关. POJ要求的输出一般有3种情况. (1)输出一个数据:数据后加换行. (2)输出一行数据:数据间用一个空格间隔(或指定的间隔符),行尾加换行(换行前可有一个空格). (3)输出多行数据:每行的数据间用一个空格间隔(或指定的间隔符),行尾只加换行. 除了少数题目没有…
题目链接 同HDU 1128 , POJ 1316(这个范围小一点). 原本怕超时,以为有技巧或者规律,死命的想,后来发现这就是一道水体,模拟着全部判断一下就好了,10秒呢,完全不怕超时...唔,废话有点多... #include<stdio.h> #include<string.h> #include<algorithm> using namespace std; int isself(int t) { ,temp,summ,i; while(n) { n=n/; l…
Log 2016-3-21 网上找的POJ分类,来源已经不清楚了.百度能百度到一大把.贴一份在博客上,鞭策自己刷题,不能偷懒!! 初期: 一.基本算法: (1)枚举. (poj1753,poj2965) (2)贪心(poj1328,poj2109,poj2586) (3)递归和分治法. (4)递推. (5)构造法.(poj3295) (6)模拟法.(poj1068,poj2632,poj1573,poj2993,poj2996) 二.图算法: (1)图的深度优先遍历和广度优先遍历. (2)最短路…
初期:一.基本算法:     (1)枚举. (poj1753,poj2965)     (2)贪心(poj1328,poj2109,poj2586)     (3)递归和分治法.     (4)递推.     (5)构造法.(poj3295)     (6)模拟法.(poj1068,poj2632,poj1573,poj2993,poj2996)二.图算法:     (1)图的深度优先遍历和广度优先遍历.     (2)最短路径算法(dijkstra,bellman-ford,floyd,hea…
初期: 一.基本算法:      (1)枚举. (poj1753,poj2965)      (2)贪心(poj1328,poj2109,poj2586)      (3)递归和分治法.      (4)递推.      (5)构造法.(poj3295)      (6)模拟法.(poj1068,poj2632,poj1573,poj2993,poj2996) 二.图算法:      (1)图的深度优先遍历和广度优先遍历.      (2)最短路径算法(dijkstra,bellman-ford…
poj 题目分类 按照ac的代码长度分类(主要参考最短代码和自己写的代码) 短代码:0.01K--0.50K:中短代码:0.51K--1.00K:中等代码量:1.01K--2.00K:长代码:2.01K以上. 短:1147.1163.1922.2211.2215.2229.2232.2234.2242.2245.2262.2301.2309.2313.2334.2346.2348.2350.2352.2381.2405.2406: 中短:1014.1281.1618.1928.1961.2054…