Time of Update: 2018-12-05
題目大意:n頭牛比賽 共比了t場,給出每場比賽的結果,求出可以確定名次的牛的頭數比如n=3 t=2 每場比賽的結果是 3 win 1 3 win 2
Time of Update: 2018-12-05
題目大意: 求3的k次冪集合{1.3.9.27.81......}中和排在第n位的子集,從小到大輸出..... Sample Input17147831125900981634049Sample Output{ }{ 3, 9 }{ 1, 9, 27 }{ 3, 9, 27, 6561, 19683 }{ 59049, 3486784401, 205891132094649, 717897987691852588770249
Time of Update: 2018-12-05
題目大意是這樣:給出n個點的座標,判斷在這些點中最多有多少個點共線。。。思路是這樣,將1~n的每一個點作為原點,將其他點的座標變換到以這個店為原點的座標繫上來並求出斜率排序,最後判斷有有多少點共線,取出最多輸出。。。按這個思路寫的代碼跑了282MS。。。 #include<iostream>#include<algorithm>#include<stdio.h>using namespace std;int main(){int
Time of Update: 2018-12-05
題目大意:給定一個字串,讓你在這個串中加入最少的字元,使其成為迴文串,(迴文串就是正著讀和反著讀一樣的串)比如:"Ab3bd"加入最少加入兩個字元才能成為迴文串"dAb3bAd"或者 "Adb3bdA"。。。。求最少添多少個字元。。。 思路:假設長度為len的字串存在str[ ]裡,初始left=0,right=len-1,如果str[left]不等於str[right]那麼則有find(letf,right)=min(find(left,rght-1),find(left+1,right)),
Time of Update: 2018-12-05
B
Time of Update: 2018-12-05
/* 給定一個母串和一些子串,找出哪些子串在母串中出現過,輸出這些子串的編號 */ #include <iostream> #include<cstdio> #include<cstring> using namespace std; const int kind = 10; int ans[10009]; int f; struct node{ node *fail; //失敗指標 node *next[
Time of Update: 2018-12-05
題目大意:給定一個遞增的序列,輸出在這個序列中的6個元素的遞增全排列。。。 #include<iostream>using namespace std;int num[20],n;void find(int i,int finded,int shows[]){int
Time of Update: 2018-12-05
/*離線並查集,邊按小到大排序,詢問也按小到大排序;對於詢問x,答案就是詢問x-1的值加上詢問x-1的L1和詢問x的L2之間的邊合并帶來的值對於一條屬於L1和L2之間的邊,如果端點u,v在一個集合中,忽略,否則新開的路是u所在集合的大小乘上v所在集合的大小*/#include<iostream>#include<cstdio>#include<cstring>#include<cmath>#include<algorithm>#incl
Time of Update: 2018-12-05
給定一個3D迷宮判斷走出去的最小步數....Sample Input3 4 5S.....###..##..###.#############.####...###########.#######E1 3 3S###E####0 0 0Sample OutputEscaped in 11 minute(s).Trapped! 我的首個BFS題,感謝小傑的教導,謝謝他。。。! 解題思路:剛開始用深搜逾時了,怎麼最佳化都不行,後來才知道這個得用寬搜,哎菜啊。
Time of Update: 2018-12-05
#include <iostream>#include<cstdio>#include<cstring>using namespace std;const int maxn=319;int f[maxn][maxn];int dis[maxn],v[maxn],vis[maxn];int ls,le;int n,m,s;void Union(){ for(int i=1;i<=n;i++) {
Time of Update: 2018-12-05
題目大姨:給定n組資料,每組資料包含兩個數a和b,求將a反轉加上b反轉然後整個再反轉的值。。水題。。 #include<iostream>using namespace std;int fan(int n){long int sum=0;while(n!=0){sum=sum*10+n%10;n/=10;}return sum;}int main(){int
Time of Update: 2018-12-05
第三個BFS題目大意:這個題是以坦克大戰為原型出來的題目,就是走迷宮的變種,給定一個地圖mxn的地圖,地圖上有普通的磚B,金磚S,河R,和一個寶物位置T,和你的位置Y,求吃到寶物的最小步數(坦克通過普通磚需要兩步,不能通過金磚和河)... Sample Input3 4YBEBEERESSTE0 0Sample
Time of Update: 2018-12-05
第5章 基礎題目選解 第 119 頁 struct bign { int len,s[maxn]; bign() { memset(s, 0, sizeof(s)); len = 1; }
Time of Update: 2018-12-05
題目大意:以連連看為原型的題目,給定地圖和地圖上兩點,求從第一個點到第二個點最少需要轉幾次彎。。。 思路:還是走迷宮的變種,將轉1.2.3......n次能到達的點都入隊,求出最少的轉彎次數 #include<iostream>using namespace std;struct mov{int x,y;}mov[4]={1,0,-1,0,0,1,0,-1};char map[80][80];int m,n,lock[4][80][80],head,rear;int queue[
Time of Update: 2018-12-05
Prime Path Time Limit : 2000/1000ms (Java/Other) Memory Limit : 131072/65536K (Java/Other)Total Submission(s) : 7 Accepted Submission(s) : 5Problem DescriptionThe ministers of the cabinet were quite upset by the message from the Chief of
Time of Update: 2018-12-05
glViewport()函數在OpenGL初始化完成之後,我們應該進行一些視圖設定。首先是設定視見地區,即告訴OpenGL應把渲染之後的圖形繪製在表單的哪個部位。當視見地區是整個表單時,OpenGL將把渲染結果繪製到整個視窗。我們調用glViewPort函數來決定視見地區:procedure
Time of Update: 2018-12-05
StatisticsEddy's picture Time Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 7 Accepted Submission(s) : 4Font: Times New Roman | Verdana | GeorgiaFont Size: ← →Problem DescriptionEddy begins to
Time of Update: 2018-12-05
E - Semi-prime H-numbersTime Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64uSubmitStatusDescriptionThis problem is based on an exercise of David Hilbert, who pedagogically suggested that one study the theory of4n+1 numbers.
Time of Update: 2018-12-05
J -Number theory-1Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d &
Time of Update: 2018-12-05
K -Number theory-2Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uSubmitStatusDescriptionEddy's interest is very extensive, recently he is interested in prime number. Eddy discover the all number owned can be divided