跳到主要內容

發表文章

目前顯示的是 6月, 2013的文章

uva 833

兩個case裡面記得要有空白行 orzzzzzzz //====================================================================|| // || // || // Author : GCA || // 6AE7EE02212D47DAD26C32C0FE829006 || //====================================================================|| #include <iostream> #include <cstdio> #include <cstring> #include <algorithm> #include <cmath> #include <climits> #include <vector> #include <set> #include <map> #include <queue> #include <cctype> #include <utility> using namespace std; #ifdef ONLINE_JUDGE #define ll "%lld" #else #define ll "%I64d" #endif typedef unsigned int uint ; typedef long long int Int; #define Set(a,s) memset(a,s, sizeof (a)) #define Write(w) freopen(w, &q

uva 11413

重點是用二分法搜尋 //====================================================================|| // || // || // Author : GCA || // 6AE7EE02212D47DAD26C32C0FE829006 || //====================================================================|| #include <iostream> #include <cstdio> #include <cstring> #include <algorithm> #include <cmath> #include <climits> #include <vector> #include <set> #include <map> #include <queue> #include <cctype> #include <utility> using namespace std; #ifdef ONLINE_JUDGE #define ll "%lld" #else #define ll "%I64d" #endif typedef unsigned int uint ; typedef long long int Int; #define Set(a,s) memset(a,s, sizeof (a)) #define Write(w) freopen(w, "w" ,std

uva 10830

MATH 概念是算完一開始的數字,順便把後面的數字上下界拿出來算 因為這個特性,所以只需要取到跟號n //====================================================================|| // || // || // Author : GCA || // 6AE7EE02212D47DAD26C32C0FE829006 || //====================================================================|| #include <iostream> #include <cstdio> #include <cstring> #include <algorithm> #include <cmath> #include <climits> #include <vector> #include <set> #include <map> #include <queue> #include <cctype> #include <utility> using namespace std; #ifdef ONLINE_JUDGE #define ll "%lld" #else #define ll "%I64d" #endif typedef unsigned int uint ; typedef long long int Int; #define Set(a,s) memset(a,s, sizeof (a)) #def

uva 10021

CUBE走迷宮,注意牆壁要雙向都擋 //====================================================================|| // || // || // Author : GCA || // 6AE7EE02212D47DAD26C32C0FE829006 || //====================================================================|| #include <iostream> #include <cstdio> #include <cstring> #include <algorithm> #include <cmath> #include <climits> #include <vector> #include <set> #include <map> #include <queue> #include <cctype> #include <utility> using namespace std; #ifdef ONLINE_JUDGE #define ll "%lld" #else #define ll "%I64d" #endif typedef unsigned int uint ; typedef long long int Int; #define Set(a,s) memset(a,s, sizeof (a)) #define Write(w) freopen(w, "w&qu

uva 957

題目有一點小陷阱,再來就是cumulative sum的做法 //====================================================================|| // || // || // Author : GCA || // 6AE7EE02212D47DAD26C32C0FE829006 || //====================================================================|| #include <iostream> #include <cstdio> #include <cstring> #include <algorithm> #include <cmath> #include <climits> #include <vector> #include <set> #include <map> #include <queue> #include <cctype> #include <utility> using namespace std; #ifdef ONLINE_JUDGE #define ll "%lld" #else #define ll "%I64d" #endif typedef unsigned int uint ; typedef long long int Int; #define Set(a,s) memset(a,s, sizeof (a)) #define Write(w) freopen(

uva 11242

水題 暴力全查找完之後sort然後看哪個最大 //====================================================================|| // || // || // Author : GCA || // 6AE7EE02212D47DAD26C32C0FE829006 || //====================================================================|| #include <iostream> #include <cstdio> #include <cstring> #include <algorithm> #include <cmath> #include <climits> #include <vector> #include <set> #include <map> #include <queue> #include <cctype> #include <utility> using namespace std; #ifdef ONLINE_JUDGE #define ll "%lld" #else #define ll "%I64d" #endif typedef unsigned int uint ; typedef long long int Int; #define Set(a,s) memset(a,s, sizeof (a)) #define Write(w) freopen(w, &quo

uva 10882

AB BC CA  given ,ABC range? AB BC CA 最大的話就是三個圓圈疊在一起,最小的圓圈就是ABC x=ABC,AB+BC+CA-2x<=100,因為每個人最多只有100個number //====================================================================|| // || // || // Author : GCA || // 6AE7EE02212D47DAD26C32C0FE829006 || //====================================================================|| #include <iostream> #include <cstdio> #include <cstring> #include <algorithm> #include <cmath> #include <climits> #include <vector> #include <set> #include <map> #include <queue> #include <cctype> #include <utility> using namespace std; #ifdef ONLINE_JUDGE #define ll "%lld" #else #define ll "%I64d" #endif typedef unsigned int uint ; typedef long long

uva 11060

拓樸排序之我不會用DFS來做這題 還有機ㄅ的重邊 //====================================================================|| // || // || // Author : GCA || // 6AE7EE02212D47DAD26C32C0FE829006 || //====================================================================|| #include <iostream> #include <cstdio> #include <cstring> #include <algorithm> #include <cmath> #include <climits> #include <vector> #include <set> #include <map> #include <queue> #include <cctype> #include <utility> using namespace std; #ifdef ONLINE_JUDGE #define ll "%lld" #else #define ll "%I64d" #endif typedef unsigned int uint ; typedef long long int Int; #define Set(a,s) memset(a,s, sizeof (a)) #define Write(w) freopen(w, &q

uva 273

  trick test一大堆 //====================================================================|| // || // || // Author : GCA || // 6AE7EE02212D47DAD26C32C0FE829006 || //====================================================================|| #include <iostream> #include <cstdio> #include <cstring> #include <algorithm> #include <cmath> #include <climits> #include <vector> #include <set> #include <map> #include <queue> #include <cctype> #include <utility> using namespace std; #ifdef ONLINE_JUDGE #define ll "%lld" #else #define ll "%I64d" #endif typedef unsigned int uint ; typedef long long int Int; #define Set(a,s) memset(a,s, sizeof (a)) #define Write(w) freopen(w, "w&quo

uva 10959

BFS一開始想成拓墣錯了 //====================================================================|| // || // || // Author : GCA || // 6AE7EE02212D47DAD26C32C0FE829006 || //====================================================================|| #include <iostream> #include <cstdio> #include <cstring> #include <algorithm> #include <cmath> #include <climits> #include <vector> #include <set> #include <map> #include <queue> #include <cctype> #include <utility> using namespace std; #ifdef ONLINE_JUDGE #define ll "%lld" #else #define ll "%I64d" #endif typedef unsigned int uint ; typedef long long int Int; #define Set(a,s) memset(a,s, sizeof (a)) #define Write(w) freopen(w, "w" ,

uva 10759

DP還需要加油... 一開始由一個骰子的一點枚舉到150 再用兩點枚舉到150 ... 然後第二個骰子加進去,用一點跟第一個骰子的資料加上去再枚舉過去 再用二點跟第一個骰子的資料(扣掉2點)的資料加起來再枚舉過去 … AC //====================================================================|| // || // || // Author : GCA || // 6AE7EE02212D47DAD26C32C0FE829006 || //====================================================================|| #include <iostream> #include <cstdio> #include <cstring> #include <algorithm> #include <cmath> #include <climits> #include <vector> #include <set> #include <map> #include <queue> #include <cctype> #include <utility> using namespace std; #ifdef ONLINE_JUDGE #define ll "%lld" #else #define ll "%I64d" #endif typedef unsigned int uint ; typedef lo

uva 617

30-60全部模擬一次=AC //====================================================================|| // || // || // Author : GCA || // 6AE7EE02212D47DAD26C32C0FE829006 || //====================================================================|| #include <iostream> #include <cstdio> #include <cstring> #include <algorithm> #include <cmath> #include <climits> #include <vector> #include <set> #include <map> #include <queue> #include <cctype> #include <utility> using namespace std; #ifdef ONLINE_JUDGE #define ll "%lld" #else #define ll "%I64d" #endif typedef unsigned int uint ; typedef long long int Int; #define Set(a,s) memset(a,s, sizeof (a)) #define Write(w) freopen(w, "w"