随笔分类 - 大整数
摘要:题意:给一个数字,看他最小是第几个菲波那切数列的前缀。 分析: 大数模板就是吊哦。 将菲波那切数列前500个数字放到字典树上。注意插入的时候不能像普通一样,只在尾节点处标记,而是一路标记下去。 #include <bits/stdc++.h> using namespace std; const i
阅读全文
摘要:之前做的大整数,都是一位一位操作。 优化方案:压缩方案。 模板: + - * 操作符重载 #include<cstdio> #include<iostream> #include<cmath> #include<algorithm> #include<cstring> #include<string
阅读全文
摘要:1003: All Your Base Time Limit: 1 Sec Memory Limit: 128 MB Submit: 4 Solved: 2 Description Premise: Given a specification for a “base” (well, actually
阅读全文
摘要:题目链接:http://acm.timus.ru/problem.aspx?space=1&num=1104 题目大意:输入一个字符串(数字与大写字母组成),输出n,n满足此字符串为n进制时,其n进位制数能被n-1整除(n不存在时输出"No solution"(不包括双引号))。 题目好多坑点,我也
阅读全文
摘要:题目链接:http://acm.nyist.net/JudgeOnline/problem.php?pid=73
阅读全文
摘要:题目链接:http://poj.org/problem?id=2389
阅读全文
摘要:题目链接:http://poj.org/problem?id=2602 http://poj.org/problem?id=1503
阅读全文