This is the first project I made using 51 series MCU, together with my two friends Pengfei Gao & Kang zhao.
We had fun
The clerk in our shool’s c[……]
February 9, 2013 MCU, Tech No comments MCU
This is the first project I made using 51 series MCU, together with my two friends Pengfei Gao & Kang zhao.
We had fun
The clerk in our shool’s c[……]
February 5, 2013 Sketch Book No comments Sketchbook
I borrowed an IPAD from Zengshen and the Sketchbook app performs better on it than that on my Android cell phone.
It is mainly because the IPAD has[……]
February 5, 2013 Sketch Book No comments Sketchbook
This is the first time that I use SketchBook, which is a software released by Autodesk.
It has Android Version and IOS Version.
And it works pe[……]
February 3, 2013 Linux No comments LAMP
LAMP means Linux + Apache + Mysql + PHP, which enables me to manage my website.
The installed software environment will be used in the Apache2 Web[……]
Even though a truck loads of dreams has not been realiazed yet
it’s still never too late if you get started right now.
20
***********************[……]
October 27, 2012 Graph Theory No comments Graph Theory
D – Til the Cows Come Home
Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u
SubmitStatus
Description
Bessie is out in[……]
October 27, 2012 Graph Theory No comments Graph Theory
Time Limit: 1000MS Memory Limit: 65536K
Total Submissions: 20995 Accepted: 6994
Description
Bessie is out in the field and wants to get b[……]
October 27, 2012 Graph Theory No comments Graph Theory
Problem Description
Machines have once again attacked the kingdom of Xions. The kingdom of Xions has N cities and N-1 bidirectional roads. The road n[……]
October 27, 2012 Graph Theory No comments Graph Theory
Problem Description
The project West-East power transmission is famous around the world. It transmits the electricity from western areas to east Ch[……]
October 27, 2012 Graph Theory No comments Graph Theory
D – Til the Cows Come Home
Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u
SubmitStatus
Description
Bessie is out in[……]
October 27, 2012 Graph Theory No comments Graph Theory
B – Agri-Net
Time Limit:1000MS Memory Limit:10000KB 64bit IO Format:%I64d & %I64u
SubmitStatus
Description
Farmer John has been elected ma[……]
October 27, 2012 Graph Theory No comments Graph Theory
B – Agri-Net
Time Limit:1000MS Memory Limit:10000KB 64bit IO Format:%I64d & %I64u
SubmitStatus
Description
Farmer John has been elected ma[……]
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 | #include <iostream> #include <cstdio> #include <cstring> #include <string> #include <algorithm> #define MAX 10000 using namespace std; int cnt;//0 int lastshow[MAX];//i,-1 int sum; int vis[MAX]; struct edge{ //a->b int to; //b int pro; //a int weight;// }e[MAX]; void insert(){ int a, b, weight; scanf("%d %d %d", &a, &b, &weight); e[cnt].to = b; e[cnt].pro = lastshow[a]; //a e[cnt].weight = weight; lastshow[a] = cnt ++; //lastshow } int dfs(int a){ if(vis[a]) return 0; // cout << endl << a << endl; vis[a] = 1; int ret = 0; int id = lastshow[a]; while(id != -1){ ret += e[id].weight; // cout << endl << e[id].weight << endl; ret += dfs(e[id].to); id = e[id].pro; } return ret; } int main(){ int n, c, srch; int i, j, k; while(cin >> n >> c){ cnt = 0; sum = 0; memset(vis, 0, sizeof(vis)); for(i = 0; i < MAX; i ++){ lastshow[i] = -1; } for(i = 0; i < c; i ++){ insert(); } //i while(~scanf("%d", &srch)){ if(-1 == srch) break; int id = lastshow[srch]; cout << "" << srch << ":"<<endl; while(id != -1){ cout << e[id].to << " " << e[id].weight << endl; id = e[id].pro; } } cout << "" << dfs(0) << endl; } return 0; } |
October 3, 2012 Graph Theory No comments Graph Theory
Description
Bob is very interested in the data structure of a tree. A tree is a directed graph in which a special node is singled out, called the “ro[……]
October 3, 2012 Computational Geometry No comments Geometry
Description
Mom and dad have a problem: their child, Reza, never puts his toys away when he is finished playing with them. They gave Reza a rectangul[……]
October 3, 2012 Computational Geometry No comments Geometry
IntersectionTime Limit:1000MS Memory Limit:10000KB 64bit IO Format:%I64d & %I64u
SubmitStatus
Description
You are to write a program that h[……]
September 12, 2012 Mathematical Modeling No comments
This C++ program is to solve the B problem during the 2012 CUMCM. The goal is to make the most use of the outside floor of a house to place the solar[……]
August 24, 2012 Mathematical Modeling No comments
There will be a competition in the autumn, so it’s time to make some preparation.
First of all, the use of Matlab and Lingo is necessary. Since I’m[……]
August 22, 2012 Essay No comments Essay
Today is the debut for my new blog: http://www.zlethic.com. And Im so happy about that. Ive always been dreaming to have my own website. This woul[……]