随笔分类 - 每日刷题瞎搞
摘要:自幂数,也称Armstrong数,是指一个 n 位数,它的每个位上的数字的n 次幂之和等于它本身。 要求程序输入一个正整数m(m≤1000000),按照指定格式输出m以内所有的自幂数。 解答: #include<stdio.h> typedef long long ll; ll qpower(ll
阅读全文
摘要:POJ3264 /* 算法过程: 1.构建线段树 2.在线段树中插入数据 3.对线段树进行更新(该题无更新操作)和查询 */ #include <cstdio> #include <algorithm> using namespace std; const int INF = 0xffffff0;
阅读全文