原创 usaco2.23Runaround Numbers

題意看了N久,判斷是不是什麼循環數 ,符合它的規定就行,模擬 /* ID: your_id_here PROG: runround LANG: C++ */ #include <iostream> #include

原创 usaco2.24Party Lamps

亂七八糟的寫 改着改着就這麼過了。。dfs枚舉 可以看出每個串前六位跟後面的都是一樣的 比較不同也就看前6位就可以了 /* ID: your_id_here PROG: lamps LANG: C++ */ #in

原创 poj1039pipe

http://poj.org/problem?id=1039 計算幾何就是麻煩 這精度那精度的。。 題意:有一打折的管道,從管口射入光線,求光線能傳播的最長x距離。 最長肯定是 一上一下的連接 枚舉所有這樣的連線 再判斷是能穿過這個折點。

原创 poj1113Wall

http://poj.org/problem?id=1113 正好是凸包的周長加一圓周 套一下各種叉積、距離的模板就OK了。 要確定一個最低點作爲凸包的起點 這個點一定得爲凸包上的點 找最低的若有多個找最左的 然後Graham-Scan算

原创 poj1408Fishnet

http://poj.org/problem?id=1408 求分割出來的最大的面積 求交點座標 枚舉n*n個面積 對這題相當無語 實在不知道精度該加哪 加了精度一直WA 去掉就AC了。 #include <iostream> #inc

原创 Codeforces Round #166 (Div. 2)

A枚舉 #include <iostream> #include<cstdio> #include<cstring> #include<stdlib.h> using namespace std; int judge(int x) {

原创 usaco2.13Healthy Holsteins(dfs枚舉)

Healthy Holsteins Burch & Kolstad Farmer John prides himself on having the healthiest dairy cows in the world. He know

原创 poj1584A Round Peg in a Ground Hole

http://poj.org/problem?id=1584 噁心的精度。。非得改得跟模板一樣纔給過了 1 判凸包 (可以共線) 2 判圓心是否在多邊形內 3 圓心到各邊的距離與r的關係 #include <iostream> #incl

原创 usaco2.14Hamming Codes

Hamming Codes Rob Kolstad Given N, B, and D: Find a set of N codewords (1 <= N <= 64), each of length B bits (1 <= B <

原创 usaco2.22Subset Sums

看懂題意後 立馬想到dfs 之後隨手寫了一個dfs TLE  看了下人家寫的才知道是揹包 /* ID: your_id_here PROG: subset LANG: C++ */ #include <iostre

原创 poj1265(pick定理)

pick公式:S = 內部的點+邊界的點/2-1; http://poj.org/problem?id=1265 題意不太好懂  給出的x,y不是座標 是前一個點往下一個走的x距離和y距離 求座標 把前面的依次加起來即可 面積可以由叉積算

原创 usaco2.11The Castle

The Castle IOI'94 - Day 1 In a stroke of luck almost beyond imagination, Farmer John was sent a ticket to the Irish Sw

原创 Codeforces Round #167 (Div. 2)

B題和C題連着兩題錯在精度上,暈了,都是一個變量忘記定義成64位的 A #include <iostream> #include<cstdio> #include<cstring> #include<algorithm> #include

原创 usaco2.12Sorting a Three-Valued Sequence

Sorting a Three-Valued Sequence IOI'96 - Day 2 Sorting is one of the most frequently performed computational tasks.

原创 usaco2.21Preface Numbering

/* ID: your_id_here PROG: preface LANG: C++ */ #include <iostream> #include<cstdio> #include<cstring> #incl