03 2016 档案
摘要:Description Recently, the bear started studying data structures and faced the following problem. You are given a sequence of integers x1, x2, ..., xn
阅读全文
摘要:免费馅饼 Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Submit Status Practice HDU 1176 免费馅饼 Submit Status Practice HDU 1176 Descrip
阅读全文
摘要:如果可以每个物品拿多件,则从小到大遍历,否则从大到小遍历。 G - Piggy-Bank Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Submit Status Practice HDU 1114 G -
阅读全文
摘要:Lifting the Stone Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Submit Status Practice HDU 1115 Lifting the Stone Submit Status
阅读全文
摘要:Find them, Catch them Time Limit:1000MS Memory Limit:10000KB 64bit IO Format:%I64d & %I64u Submit Status Practice POJ 1703 Find them, Catch them Submi
阅读全文
摘要:Is It A Tree? Time Limit:1000MS Memory Limit:10000KB 64bit IO Format:%I64d & %I64u Submit Status Practice POJ 1308 Is It A Tree? Submit Status Practic
阅读全文
摘要:#include<iostream> #include<stdio.h> #include<algorithm> #include<math.h> using namespace std; int par[103]; struct Island { int x,y; } isl[103]; stru
阅读全文
摘要:C - 食物链 Time Limit:1000MS Memory Limit:10000KB 64bit IO Format:%I64d & %I64u Submit Status Practice POJ 1182 C - 食物链 Submit Status Practice POJ 1182 D
阅读全文
摘要:The Suspects Time Limit: 1000MS Memory Limit: 20000K Total Submissions: 30522 Accepted: 14836 Description Severe acute respiratory syndrome (SARS), an
阅读全文
摘要://#include<bits/stdc++.h> #include<iostream> #include<stdio.h> #define max1 50005 using namespace std; int pa[max1],vis[max1]; int find(int a) { while
阅读全文
摘要:Description 严重急性呼吸系统综合症( SARS), 一种原因不明的非典型性肺炎,从2003年3月中旬开始被认为是全球威胁。为了减少传播给别人的机会, 最好的策略是隔离可能的患者。 在Not-Spreading-Your-Sickness大学( NSYSU), 有许多学生团体。同一组的学生
阅读全文
摘要:http://acm.zzkun.com/archives/717 这个大神的解答非常,额 猥琐。但是实在是太强了。感觉所有的大数都可以用 long double 了。
阅读全文
摘要:#include<bits/stdc++.h> #define MAX 155 using namespace std; struct Node { int exp; int pat; }mon[155]; int dp[MAX][MAX]; int main() { int n,m,k,s; in
阅读全文
摘要:#include<bits/stdc++.h> using namespace std; struct Bank { double cau; int money; }bank[105]; double dp[10005]; int main() { int n; cin>>n; while(n--)
阅读全文
摘要:Description Input Output Sample Input Sample Output
阅读全文
摘要:Description It's commonly known that the Dutch have invented copper-wire. Two Dutch men were fighting over a nickel, which was made of copper. They we
阅读全文
摘要:这两道题基本思路是一样的,不过uva147的输出实在是个大坑,因为double的问题,所以考虑精度的损失。 代码中的输出部分被我注释掉的那一部分是错误的输出,格式什么的都是正确的,但是存在精度的损失。应该注意一下 hdu1284 Description Input Output Sample Inp
阅读全文
摘要:http://www.cnblogs.com/songacm/p/3537419.html 引用自这篇博客,真·大神
阅读全文
摘要:Description In ``Hangman Judge,'' you are to write a program that judges a series of Hangman games. For each game, the answer to the puzzle is given a
阅读全文
摘要:Description In this problem you are to generate a triangular wave form according to a specified pair of Amplitude and Frequency. The input begins with
阅读全文
摘要:Description Your mission, if you decide to accept it, is to create a maze drawing program. A maze will consist of the alphabetic characters A-Z, *(ast
阅读全文
摘要:这道题的难点在于怎么确定读取一行数据,用fgets读取数据流中的所有字符。 fgets(s,size,stdin);//从标准输入流中读取一行数据到s[]里面去。
阅读全文
摘要:Description An imaging device furnishes digital images of two machined surfaces that eventually will be assembled in contact with each other. The roug
阅读全文
摘要:#include<stdio.h> int main(){ char c; int j; while((c = getchar())!= EOF){ if(c != '\n'){ putchar(c-7); } else putchar(c); } return 0; }
阅读全文
摘要:#include<bits/stdc++.h>using namespace std;int main(){ int n=0; char a; int flag=1; while((scanf("%c",&a)!=EOF)) { if(a>='a'&&a<='z'||a>='A'&&a<='Z')
阅读全文
摘要:#include using namespace std; int main() { int n,m; unsigned long long int a,b,c,sum; while((scanf("%d",&n)!=EOF)) { for(int i=0;i>m; sum=0; for(int i=...
阅读全文
摘要:Description Kefa decided to celebrate his first big salary by going to the restaurant. He lives by an unusual park. The park is a rooted tree consisti
阅读全文
摘要:#include<bits/stdc++.h> using namespace std; int main() { int n; cin>>n; int v=0; int e=0 ; for(int i=0;i<=n-2;i++) { v+=i*(n-i-2); e+=(i*(n-i-2)+1);
阅读全文
摘要:#include<bits/stdc++.h> using namespace std; struct pos { double x; double y; }; //计算三角形的有向面积 double area(double x0,double y0,double x1,double y1,doub
阅读全文
摘要:#include<bits/stdc++.h> using namespace std; int main() { int flag[100]; int prime[100]; memset(flag,true,sizeof(flag)); memset(prime,0,sizeof(prime))
阅读全文
摘要:#include<bits/stdc++.h> #define max 100 using namespace std; int flag[max]; int prime[max]; int main() { int t=0; memset(flag,1,sizeof(flag)); for(int
阅读全文
摘要:题目描述 如下数列,前5项分别是1/1,1/2,2/1,3/1,2/2……。输入n,输出第n项。 1/1 1/2 1/3 1/4 1/5 2/1 2/2 2/3 2/4 3/1 3/2 3/3 4/1 4/2 5/1 样例输入 3 14 7 12345 样例输出 2/1 2/4 1/4 59/99
阅读全文
摘要:.定义一个二维数组 char **array1 array1 = new char *[x]; for(i=0;i<x;++i) array1[i] = new char[y]; ...用的时候可以直接array1[i][j] 注意delete for(i=0;i<x;++i) delete[] a
阅读全文
摘要:#include<bits/stdc++.h> using namespace std; int main() { int n; cin>>n; string str; while(n--) { cin>>str; string two; int len=str.length(); for(int
阅读全文
摘要:<?php require_once '../include.php'; checkLogined(); $rows=getAllCate(); //echo $rows; if(!$rows){ alertMes("没有相应分类,请先添加分类!!", "addCate.php"); } ?> <!
阅读全文
摘要:int 1e6 long 1e9; long long 1e18;
阅读全文
摘要:问题描述 Fibonacci数列的递推公式为:Fn=Fn-1+Fn-2,其中F1=F2=1。 当n比较大时,Fn也非常大,现在我们想知道,Fn除以10007的余数是多少。 输入格式 输入包含一个整数n。 输出格式 输出一行,包含一个整数,表示Fn除以10007的余数。 说明:在本题中,答案是要求Fn
阅读全文