11 2013 档案

摘要:void get_div() //筛因子{ for(int i=2; i<maxn; i++) for(int j=i; j<maxn; j+=i) dx[j].push_back(i);}View Code 阅读全文
posted @ 2013-11-17 21:06 等待最好的两个人 阅读(324) 评论(0) 推荐(0)
摘要:题目链接:http://codeforces.com/problemset/problem/264/B代码:#include#include#include#includeusing namespace std;const int maxn = 105000;int dp[maxn];vector dx[maxn];void get_div() //筛因子{ for(int i=2; i>n) { memset(dp,0,sizeof(dp)); for(int i=1; i>a; int Max = 1; ... 阅读全文
posted @ 2013-11-17 21:05 等待最好的两个人 阅读(209) 评论(0) 推荐(0)
摘要:题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3549最核心的是由于m^n 太大, 存不下了,存下来的复杂度也太高,就只能边运算边取模,看别人的代码才想到。0s 不会很多,就暴力枚举。import java.math.*;import java.util.*;public class Main { static BigInteger Fast_Power(BigInteger x ,BigInteger n, BigInteger mod) { BigInteger ret = Bi... 阅读全文
posted @ 2013-11-16 09:28 等待最好的两个人 阅读(300) 评论(0) 推荐(0)
摘要:题目链接:http://codeforces.com/contest/294/problem/C代码:import java.util.*;import java.math.*;public class Main { public static void main(String[] args){ Scanner cin = new Scanner(System.in); BigInteger[] fir; fir = new BigInteger[1050]; fir[0] = fir[0].ONE; for(int ... 阅读全文
posted @ 2013-11-01 16:48 等待最好的两个人 阅读(198) 评论(0) 推荐(0)