Time of Update: 2018-12-05
/*The trip注意特殊資料的處理,誤差不超過0.01即可。*/#include<iostream>#include<cstdio>using namespace std;double a[1005];int main(){ // freopen("./pcio/110103.inp","r",stdin); int n,i; while(~scanf("%d",&n)) { if(n==0)
Time of Update: 2018-12-05
/* LC-Display 蛋疼的類比題 注意輸出的特殊行,如第1行、第2到s+2行、 第s+3到2*s+2行、第2*s+3行,總共有2*s+3行,每一行輸出的大小就可以根據s的大小控制了。 數字最大位元為8位*/#include <iostream>#include <cstring>#include<cstdio>using namespace std;#define MAXLENGTH 8void lcd_display (long size,
Time of Update: 2018-12-05
// zoj 1649#include<stdio.h>#include<queue>#include<string.h>using namespace std;#define MAXN 200#define INF 1000000struct point{ int x,y; int step,time;};queue<point> Q;int N,M,ax,ay;char map[MAXN][MAXN];int time[MAXN][
Time of Update: 2018-12-05
/* AOV網路及拓撲排序1、在有向非循環圖中,用頂點表示活動,用有向邊<u,v>表示活動u必須先與活動v,這種有向圖叫AOV網路。2、若<u,v>,則u是v的直接前驅,v是u的直接後繼;若<u,u1,u2,···un,v>則稱u是v的前驅,v是u的後繼。3、前驅後繼關係有傳遞性和反自反性。則可以推斷AOV網路必須是有向非循環圖。4、拓撲排序實現方法: 1)從AOV網路中選擇一個入度為0的頂點並輸出;
Time of Update: 2018-12-05
免費餡餅 Time Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other)Problem Description都說天上不會掉餡餅,但有一天gameboy正走在回家的小徑上,忽然天上掉下大把大把的餡餅。說來gameboy的人品實在是太好了,這餡餅別處都不掉,就掉落在他身旁的10米範圍內。
Time of Update: 2018-12-05
In the 2020 grid below, four numbers along a diagonal line have been marked in red.08 02 22 97 38 15 00 40 00 75 04 05 07 78 52 12 50 77 91 0849 49 99 40 17 81 18 57 60 87 17 40 98 43 69 48 04 56 62 0081 49 31 73 55 79 14 29 93 71 40 67 53 88 30 03 4
Time of Update: 2018-12-05
The sequence of triangle numbers is generated by adding the natural numbers. So the 7th triangle number would be 1 + 2 + 3 + 4 + 5 + 6 + 7 = 28. The first ten terms would be:1, 3, 6, 10, 15, 21, 28, 36, 45, 55, ...Let us list the factors of the first
Time of Update: 2018-12-05
http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2267將騎士和龍頭都按升序排序,按順序如果騎士值大於所有龍頭則可以繼續,如果可以殺掉所有龍頭則輸出騎士和否則不行。#include<iostream>#include<cstdio>#include<cstring>#include<algo
Time of Update: 2018-12-05
#include <iostream>#include <map>#include <string>using namespace std;int main(){ multimap<string,string>mulmap; multimap<string,string>::iterator p; typedef multimap<string,string>::value_type vt;
Time of Update: 2018-12-05
HDU-1394-Minimum Inversion Numberhttp://acm.hdu.edu.cn/showproblem.php?pid=1394題意是給出n個數,求其逆序數,並每次將第一個數移至最後,再求其逆序數,求這n個排列中逆序數最小的一個逆序數的簡單定義:The inversion number of a givennumber sequence a1, a2, ..., an is the number of pairs (ai, aj) that satisfy
Time of Update: 2018-12-05
#include<stdio.h>#include<stdlib.h>int x[21][21];int main(){ int i,j,n,m; // freopen("input.txt","r",stdin); while(scanf("%d%d",&n,&m)!=EOF) { int s[21][21]= {0}; if(m==0||n==0) break;
Time of Update: 2018-12-05
http://acm.hdu.edu.cn/showproblem.php?pid=1702#include<iostream>#include<cstdio>#include<cstring>#include<list>using namespace std;int main(){ // freopen("1.txt","r",stdin); int n; scanf("%d",&n); while(n--)
Time of Update: 2018-12-05
HDU-2577-How to
Time of Update: 2018-12-05
http://acm.hdu.edu.cn/showproblem.php?pid=1213#include<iostream>#include<cstdio>using namespace std;#define N 1000int father[N];void ufset(){ for(int i=0;i<N;i++) father[i]=-1;}int find(int x){ int s; for(s=x;father[s]&
Time of Update: 2018-12-05
https://projecteuler.net/problem=41、它是迴文數2、存在2個三位元乘積等於它。 1 #include<iostream> 2 #include<cstdio> 3 using namespace std; 4 bool is_ok(int x) 5 { 6 if(x%10!=x/100000 || (x/10)%10!=(x/10000)%10 || (x/100)%10!=(x/1000)%10) 7
Time of Update: 2018-12-05
#include<iostream>#include<cstdio>#include<algorithm>using namespace std;#define maxn 11#define maxm 20struct edge{ int u,v,w;}edges[maxm];int father[maxn];int m,n;void ufset(){ for(int i=0; i<=n; i++) father[i]=-1;}
Time of Update: 2018-12-05
#include<iostream>#include<cstdio>using namespace std;#define lson l,m,rt<<1#define rson m+1,r,rt<<1|1const int maxn=555555;int sum[maxn<<2];void pushup(int rt){ sum[rt]=sum[rt<<1]+sum[rt<<1|1];}void
Time of Update: 2018-12-05
#include<iostream>#include<cstdio>#include<algorithm>using namespace std;#define lson l,m,rt<<1#define rson m+1,r,rt<<1|1const int maxn=200005;int MAX[maxn<<2];void pushup(int rt){
Time of Update: 2018-12-05
hdu 1394http://acm.hdu.edu.cn/showproblem.php?pid=1394用線段樹求逆序數,例如要求x的逆序數只需要訪問(x+1,n)段有多少個數,就是x的逆序數。還有就是求最小逆序數的時候有個巧妙的想法,當把x放入數組的後面,此時的逆序數應該為x沒放入最後面之前的逆序總數加上(n-x)再減去(x-1);sum =
Time of Update: 2018-12-05
下載好的JDK是一個可執行安裝程式,雙擊安裝。將安裝路徑改為:C:\jdk1.6.0(當然其他路徑也可以)。JDK安裝完成之後我們進行JDK環境變數設定:我的電腦點右鍵,選擇“屬性”,選擇“進階”標籤,進入環境變數設定,分別設定如下三個環境變數:(1)設定好path變數,使得我們能夠在系統中的任何地方運行java應用程式,比如javac、java、javah等等,這就要找到我們安裝JDK的目錄,比如我們的JDK安裝在C:\jdk1.6.0目錄下,那麼在C:\jdk1.6.0\bin目錄下就是我們