摘要: #include <iostream>#include <cstdio>using namespace std;const int MOD = 3761599;const int MAXN = 1100010;int e[MAXN], f[MAXN], temp[MAXN];void init(){ long long t = 1; for (int i = 1; i < MAXN; i++) { t *= i; t = t % MOD; temp[i] = t; } temp[0] = 1;}int gcd(int a,... 阅读全文
posted @ 2012-08-18 15:53 徐徐而来 阅读(173) 评论(0) 推荐(0) 编辑
摘要: 堆栈,单调队列#include<iostream>#include<queue>#include<algorithm>#include<stdio.h>#include<cmath>using namespace std;#define MAXN 500000000struct Point{ int val,pos;};int n,m,x,t;int dp[101][10010];int g[101][10010];int dist[10010];bool operator < (Point a,Point b){ return 阅读全文
posted @ 2012-08-18 14:37 徐徐而来 阅读(158) 评论(0) 推荐(0) 编辑
摘要: 请点击“文件”→“打开”,在打开文件对话框中的文件类型下拉框中选择“从任意文件中恢复文本”项,再点击原先打不开的文件,假设Microsoft Word2003安装在Windows XP中的C盘。进入C:/Documents and Settings/用户名/ApplicationData/Microsoft/Word,在Word文件夹下,我们会看到后缀名为.asd的文件,此时,只要将扩展名.asd更改为.doc,找回未保存文档:开始 → 运行 → %appdata%\microsoft\Word → 确定;在打开的目录下,找到与未保存文档同名的 xxx.asd “挽救文档”文件;将其重命名为 阅读全文
posted @ 2012-03-18 11:26 徐徐而来 阅读(945) 评论(0) 推荐(0) 编辑
摘要: import java.math.BigInteger;import java.util.Scanner;public class Main { public static void main(String[] args) { Scanner cin=new Scanner(System.in); int t=cin.nextInt(); int prime[]=new int [100]; prime[1]=2; for (int i=2;i<=80;i++) { int j=pr... 阅读全文
posted @ 2012-03-10 23:46 徐徐而来 阅读(165) 评论(0) 推荐(0) 编辑
摘要: 1 /* 2 网络图用临接矩阵表示 3 算法复杂 4 度边数m顶点数n 5 O(n*m*m) 6 寻找增广路径用bfs 7 */ 8 #include<iostream> 9 #include<stdio.h>10 #include<queue>11 #include<cstring>12 using namespace std;13 #define MaxSize 100014 #define MaxNum 0xfffffff15 int g[MaxSize][MaxSize];16 17 int Augment(int g[][MaxSize 阅读全文
posted @ 2012-02-20 23:34 徐徐而来 阅读(258) 评论(0) 推荐(1) 编辑
摘要: View Code 1 #include<iostream> 2 #include<stdio.h> 3 #include<queue> 4 #include<cstring> 5 using namespace std; 6 #define MaxSize 1000 7 #define MaxNum 0xfffffff 8 int g[MaxSize][MaxSize]; 9 10 int Augment(int g[][MaxSize],int n,int s,int t)11 {12 deque<int> q;13 int pr 阅读全文
posted @ 2012-02-20 23:24 徐徐而来 阅读(134) 评论(0) 推荐(0) 编辑
摘要: 1 import java.text.*; 2 import java.util.*; 3 public class ACM2 { 4 public static void main(String[] args) { 5 DecimalFormat f=new DecimalFormat("0.00"); 6 DecimalFormat g=new DecimalFormat("0.0#"); 7 Scanner cin=new Scanner (System.in); 8 double x=cin.nextDouble... 阅读全文
posted @ 2012-02-20 00:11 徐徐而来 阅读(368) 评论(0) 推荐(1) 编辑
摘要: 1 public class TestStatic { 2 public static void main(String[] args) { 3 StaticT.tes(); 4 StaticT s=new StaticT(); 5 s.tes(); 6 } 7 8 } 9 class StaticT {10 static void tes() {11 System.out.println("fssf");12 }13 }我一开始把TestStatic类中的main方法中没有写new Stati... 阅读全文
posted @ 2012-02-19 23:55 徐徐而来 阅读(521) 评论(0) 推荐(1) 编辑
摘要: 1 // Input n Ouput n! using BigInteger 2 3 import java.text.*; 4 import java.util.*; 5 import java.math.*; 6 public class ACM1 { 7 public static void main(String[] args) { 8 Scanner cin=new Scanner (System.in); 9 int n=cin.nextInt();10 BigInteger s=BigInteger.valueOf(... 阅读全文
posted @ 2012-02-19 23:42 徐徐而来 阅读(207) 评论(0) 推荐(0) 编辑
摘要: Download ManagerTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 248 Accepted Submission(s): 132Problem DescriptionJiajia downloads a lot, a lot more than you can even imagine. Some say that he starts downloading up to 20,000 files together. If 20, 阅读全文
posted @ 2012-02-19 21:08 徐徐而来 阅读(232) 评论(0) 推荐(0) 编辑