11 2012 档案

摘要:1 #include<stdio.h> 2 #include<iostream> 3 #include<math.h> 4 using namespace std; 5 typedef __int64 ll; 6 int main() 7 { 8 int t,ans; 9 scanf("%d",&t);10 int n;11 ll locb,loca;12 while(t--)13 {14 scanf("%d",&n);15 locb = ceil(sqrt(2*(double)n+0.25)-0.5) 阅读全文
posted @ 2012-11-22 21:48 M_cag 阅读(195) 评论(0) 推荐(0)
摘要:#include<stdio.h>#include<string.h>const int mod = 9973;#define maxn 15struct matrix{ int arr[maxn][maxn];};matrix mul(struct matrix a,struct matrix b,int n){ int i,j,k,temp; struct matrix val; for(i=1;i<=n;i++) for(j=1;j<=n;j++) { for(k=1,temp=0;k<=n;k++) ... 阅读全文
posted @ 2012-11-21 17:16 M_cag 阅读(174) 评论(0) 推荐(0)
摘要:1 import java.io.*; 2 import java.text.*; 3 import java.math.*; 4 import java.util.*; 5 public class Main { 6 7 /** 8 * @param args 9 */10 public static void main(String[] args) {11 // TODO 自动生成的方法存根12 Scanner cin = new Scanner(new BufferedInputStream(System.in));... 阅读全文
posted @ 2012-11-15 14:51 M_cag 阅读(208) 评论(0) 推荐(0)
摘要:北师大ACM新手指导第十二题-高精度乘法应用Time Limit: 1000 ms Case Time Limit: 1000 ms Memory Limit: 65536 KBSubmit: 150 Accepted: 54 [Prev][Next]Description正式比赛时,高精度乘法的题目一般都有较大的变形,选手应该充分理解高精度的算法,然后对应不同的题目,对代码作相应的修改,以下是一道正式的ACM高精度题,它可以算作一道比较典型的ACM题目:1、虽然有现成的算法,却无法直接套用,必须根据题目作相应的变型。2、数据有一定的陷阱,要考虑到各种特殊的情况。好,让我们一起努力把这道... 阅读全文
posted @ 2012-11-14 19:05 M_cag 阅读(575) 评论(0) 推荐(0)
摘要:import java.io.*;import java.math.*;import java.util.*;public class Main { /** * @param args */ public static void main(String[] args) { // TODO 自动生成的方法存根 Scanner cin = new Scanner(new BufferedInputStream(System.in)); int n,num; n = cin.nextInt(); BigInteger a,b,ans; for(int i=1 ;i<=n;i++){ ... 阅读全文
posted @ 2012-11-14 16:13 M_cag 阅读(258) 评论(0) 推荐(0)
摘要:1 #include<stdio.h> 2 #include<string.h> 3 #include<algorithm> 4 using namespace std; 5 #define maxn 1005 6 int fa[maxn],degree[maxn]; 7 8 int findfather(int x) 9 {10 if(fa[x]!=x)11 fa[x]=findfather(fa[x]);12 return fa[x];13 }14 void init(int n)15 {16 int i;17 memset(degree... 阅读全文
posted @ 2012-11-02 16:24 M_cag 阅读(600) 评论(0) 推荐(0)