原创 hdu 5017 Ellipsoid 模擬退火算法 西安網絡賽

Given a 3-dimension ellipsoid(橢球面) your task is to find the minimal distance between the original point (0,0,0) and po

原创 C語言 位字段的使用

C語言 位字段的使用樣例:#include <stdio.h> typedef unsigned int UINT; typedef struct { //位字段 UINT a : 4; //4 bit UINT b :

原创 C語言 單鏈表的基本操作

#include <stdio.h> #include <string.h> typedef int ElemType; typedef struct LNode { ElemType data; struct LNod

原创 utilities.h

51單片機 板子內部引腳電路對應的鎖存端聲明及常用類型定義的頭文件 #ifndef UTILITIES_H_INCLUDED #define UTILITIES_H_INCLUDED typedef unsigned char uch

原创 51單片機 簡易加法計算器

#include <reg52.h> typedef unsigned char uchar; typedef unsigned int uint; typedef unsigned long ulong; sbit ADDR0 =

原创 頭文件定義

#include <cstdio> #include <iostream> #include <cstring> #include <string> #include <cmath> #include <queue> #include <

原创 51單片機 矩陣按鍵的掃描、消抖、動作分離

#include <reg52.h> sbit ADDR0 = P1^0; sbit ADDR1 = P1^1; sbit ADDR2 = P1^2; sbit ADDR3 = P1^3; sbit ENLED = P1^4; sbit

原创 hdu 5017 Ellipsoid 模擬退火算法模板

//109MS 304K #include <cstdio> #include <iostream> #include <cmath> #include <algorithm> using namespace std; const do

原创 hdu 4998 Rotate

平面上有一個二維座標軸上,進行n次操作,把座標軸繞着(x,y) (這個座標總是初始座標軸的座標) 逆時針轉p弧度。最後的結果相當於進行一次操作,即繞着(X, Y) 逆時針旋轉了P弧度。求 X,Y,P,題目保證總有解.其實可以發現,最後的P

原创 51單片機C語言開發之花樣流水燈程序

#include <reg52.h> typedef unsigned char uchar; typedef unsigned int uint; //int是16位的 sbit ADDR0 = P1^0; sbit ADDR1 =

原创 zoj 3818 Pretty Poem

//AC #include <cstdio> #include <iostream> #include <cstring> #include <string> #include <algorithm> using namespace s

原创 hdu 5023 A Corrupt Mayor's Performance Art 廣州網絡賽 線段樹的區間覆蓋+種類查詢

Problem Description The wall was divided into N segments and the width of each segment was one cun(cun is a Chinese len

原创 ZIGBEE CC2430 使用Timer2定時器進行計數中斷設置

#include <emot.h> #define uint unsigned int #define uchar unsigned char uint cnt = 0; uchar tmpFlag; void delay(uint

原创 C++ 輸入輸出外掛 整數

#include <cstdio> #include <iostream> using namespace std; inline void getInt(int* p) { char ch; do {

原创 Line.h

#ifndef LINE_H_INCLUDED #define LINE_H_INCLUDED //#define Point Vector struct Line { Point P; Vector V; //直線的點