51-MCU Project: Canteen order device

February 9, 2013 MCU, Tech No comments

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 canteen would always shout very loud to remind you that your food is ready. So it is always very noise in the canteen. Then we came out with the idea o[……]

Read more

draw Taylor Swift 2

February 5, 2013 Sketch Book No comments

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 a larger screen and it displays a more accurate color.

Since Taylor Swift released her new album recently, so I paint the cover of the new album t[……]

Read more

draw Taylor Swift 1

February 5, 2013 Sketch Book No comments

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 perfectly on my Android cell phone.

By the way, I love Taylor Swift sooooo much ~~ #^_^

LAMP installation in Ubuntu 12.04

February 3, 2013 Linux No comments

LAMP means Linux + Apache + Mysql + PHP, which enables me to manage my website.

The installed software environment will be used in the Apache2 Web services software, the MySQL5 website back-end database software, as well as PHP5 script interpreted language software, and the system can also be con[……]

Read more

20th Birthday: Dream On

December 8, 2012 Essay 1 comment

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

********************************************************************************************************************************************
20

1820

Follow your h[……]

Read more

SPFA:Til the Cows Come Home

October 27, 2012 Graph Theory No comments

D – Til the Cows Come Home
Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u
SubmitStatus

Description
Bessie is out in the field and wants to get back to the barn to get as much sleep as possible before Farmer John wakes her for the morning milking. Bessie needs her be[……]

Read more

BellmanFord: Til the cows come home

October 27, 2012 Graph Theory No comments

Time Limit: 1000MS Memory Limit: 65536K
Total Submissions: 20995 Accepted: 6994

Description
Bessie is out in the field and wants to get back to the barn to get as much sleep as possible before Farmer John wakes her for the morning milking. Bessie needs her beauty sleep, so she wants to[……]

Read more

Kruskal: Matrix

October 27, 2012 Graph Theory No comments

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 network is such that there is a
unique path between any pair of cities.

Morpheus has the news that K Machines are planning to destroy the whole kin[……]

Read more

SPFA: Power Transmission

October 27, 2012 Graph Theory No comments

Problem Description

The project West-East power transmission is famous around the world. It transmits the electricity from western areas to east China. There are many nodes in the power system. Each node is connected with several other nodes in the system by cable. Power can be only transmitted b[……]

Read more

Dijkstra: Till the Cows Come Home

October 27, 2012 Graph Theory No comments

D – Til the Cows Come Home
Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u
SubmitStatus

Description
Bessie is out in the field and wants to get back to the barn to get as much sleep as possible before Farmer John wakes her for the morning milking. Bessie needs her be[……]

Read more

Kruscal: Agri-Net

October 27, 2012 Graph Theory No comments

B – Agri-Net
Time Limit:1000MS Memory Limit:10000KB 64bit IO Format:%I64d & %I64u
SubmitStatus

Description
Farmer John has been elected mayor of his town! One of his campaign promises was to bring internet connectivity to all farms in the area. He needs your help, of course.
Farmer John[……]

Read more

Prim: Agri-Net

October 27, 2012 Graph Theory No comments

B – Agri-Net
Time Limit:1000MS Memory Limit:10000KB 64bit IO Format:%I64d & %I64u
SubmitStatus

Description
Farmer John has been elected mayor of his town! One of his campaign promises was to bring internet connectivity to all farms in the area. He needs your help, of course.
Farmer John[……]

Read more

October 3, 2012 Graph Theory No comments

eg

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;
}

Color A Tree

October 3, 2012 Graph Theory No comments

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 “root” of the tree, and there is a unique path from the root to each of the other nodes.

Bob intends to color all the nodes of a tree with a pen. A tr[……]

Read more

+Toy Storage

October 3, 2012 Computational Geometry No comments

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 rectangular box to put his toys in. Unfortunately, Reza is rebellious and obeys his parents by simply throwing his toys into the box. All the toys get mixed up[……]

Read more

: Intersection

October 3, 2012 Computational Geometry No comments

IntersectionTime Limit:1000MS Memory Limit:10000KB 64bit IO Format:%I64d & %I64u
SubmitStatus

Description
You are to write a program that has to decide whether a given line segment intersects a given rectangle.

An example:
line: start point: (4,9)
end point: (11,2)
rectangle: left-t[……]

Read more

2012 CUMCM

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 cells so that to maximize the profit.


12
0,12SM

a,b,c
SMSM

1 Matlab
2 Matlab
3 C/C++(

3e811c7f4d154a19d7c4e1041373[……]

Read more

My Preliminary Plan On Mathematical Modeling

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 not very familiar with this two softwares, I’d better get started with some basic grammar and I bought two books for them.

Of the same importance[……]

Read more

Let’s Start From Here

August 22, 2012 Essay No comments

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 would be a blog of an telecommunication engineer who loves algorithm and rock music. Anyway, thanks to Tsenmus tech- support and his server~

This blog[……]

Read more