![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
UVa
文章平均质量分 62
码龙喵
这个作者很懒,什么都没留下…
展开
-
UVa 712 S-Trees
好几天没做题了,都快退化了,早上刚1A了一题。/* coder: ACboy date: 2010-3-13 result: 1A description: UVa 712 S-Trees*/#include #include #include using namespace std;struct Node { struct Node * l原创 2010-03-14 10:49:00 · 1115 阅读 · 0 评论 -
UVa 10098 Generating Fast
STL的next_permutation()求全排列/* coder: ACboy date: 2010-3-19 result: 1A description: UVa 10098 Generating Fast*/#include #include using namespace std;int main(){ int n; char原创 2010-03-19 09:23:00 · 903 阅读 · 0 评论 -
UVa 216 Getting in Line(回溯版)
/* coder: ACboy date: 2010-3-19 result: AC description: UVa 216 Getting in Line*/#include #include using namespace std;struct node { double x; double y;};struct Ans {原创 2010-03-19 16:16:00 · 864 阅读 · 0 评论 -
UVa 539 The Settlers of Catan
/* coder: ACboy date: 2010-3-19 result: AC description: UVa 539 The Settlers of Catan*/#include using namespace std;int edges[30][30];int vis[30][30];int v[30];int c;int be原创 2010-03-19 22:05:00 · 694 阅读 · 0 评论 -
UVa 729 The Hamming Distance Problem
Brute force + backtracking/* coder: ACboy date: 2010-3-19 result: 1A description: UVa 729 The Hamming Distance Problem*/#include using namespace std;// 用于保存所有生产的结果char data[130原创 2010-03-19 12:15:00 · 1017 阅读 · 0 评论 -
UVa 10310 Dog and Gopher(long long)
/* coder: ACboy date: 2010-3-21 result: AC description: UVa 10310 Dog and Gopher*/#include #include using namespace std;struct Point { long long x; long long y;};Point原创 2010-03-21 12:38:00 · 931 阅读 · 0 评论 -
UVa 10310 Dog and Gopher(double)
/* coder: ACboy date: 2010-3-21 result: AC description: UVa 10310 Dog and Gopher*/#include #include using namespace std;#define EPS 1e-6struct Point { double x; double y;原创 2010-03-21 12:53:00 · 1024 阅读 · 0 评论 -
UVa 167 - The Sultan's Successors
好几天没AC了,晚上AC一下找找感觉,本题是八皇后问题的变种。/* File: 167.cpp Author: ACboy Date: 2010-3-25 Result: 1A Description: UVa 167 - The Sultans Successors*/#include using namespace std;struct Ans原创 2010-03-25 19:43:00 · 1361 阅读 · 0 评论 -
UVa 140 - Bandwidth
/* File: 140.cpp Author: ACboy Date: 2010-3-25 Result: 1A Description: UVa 140 - Bandwidth*/#include #include using namespace std;int data[80][80];int vis[30];int getMax(原创 2010-03-25 21:05:00 · 1605 阅读 · 2 评论 -
UVa 167 - The Sultan's Successors(2)
/* File: 167.cpp Author: ACboy Date: 2010-3-25 Result: 1A Description: UVa 167 - The Sultans Successors*/#include using namespace std;int data[10][10];int viscolumn[10];int原创 2010-03-25 19:58:00 · 1259 阅读 · 0 评论 -
UVa 146 ID Codes
STL中的next_permutation()下一个排列的简单应用/* coder: ACboy date: 2010-3-19 result: AC description: UVa 146 ID Codes*/#include #include using namespace std; int main() {原创 2010-03-19 09:11:00 · 944 阅读 · 0 评论 -
UVa 11205 The broken pedometer
子集枚举,很黄很暴力/* coder: ACboy date: 2010-3-18 result: AC description: UVa 11205 The broken pedometer*/#include using namespace std;char data[110][20];char temp[110][20];int a[40原创 2010-03-18 19:52:00 · 1139 阅读 · 0 评论 -
UVa 11218 KTV
/* coder: ACboy date: 2010-3-17 result: AC description: UVa 11218 KTV*/#include using namespace std;struct node{ int d[3]; int score;};int evPosb[85000][4];node dat原创 2010-03-17 22:29:00 · 1003 阅读 · 0 评论 -
UVa 327 Evaluating Simple C Expressions
/* coder: ACboy date: 2010-3-14 result: 1A description: UVa 327 Evaluating Simple C Expressions*/#include #include using namespace std;struct Node { char name; int value; i原创 2010-03-14 18:53:00 · 1218 阅读 · 0 评论 -
UVa 572 Oil Deposits (非递归版)
/* coder: ACboy date: 2010-3-16 result: 1A description: UVa 572 Oil Deposits*/#include using namespace std;int m, n;int data[256][256];int vis[256][256];int dx[] = {1, 0, -原创 2010-03-16 14:10:00 · 619 阅读 · 0 评论 -
UVa 572 Oil Deposits (递归版)
/* coder: ACboy date:2010-3-16 result: 1A description: UVa 572 Oil Deposits*/#include using namespace std;int m, n;int data[256][256];int vis[256][256];int dx[] = {0, 1,原创 2010-03-16 12:44:00 · 682 阅读 · 0 评论 -
UVa 657 The die is cast
/* coder: ACboy date: 2010-3-16 result: AC description: UVa 657 The die is cast*/#include #include using namespace std;int data[100][100];int temp[100][100];int vis[100][100]原创 2010-03-16 15:26:00 · 1054 阅读 · 0 评论 -
UVa 784 Maze Exploration
/* coder: ACboy date: 2010-3-16 result: 1A description: UVa 784 Maze Exploration*/#include using namespace std;char data[40][90];int vis[40][90];int dx[] = {0, 0, 1, 1, -1, -原创 2010-03-16 20:31:00 · 1158 阅读 · 0 评论 -
UVa 10167 - Birthday Cake
这题很黄很暴力/* coder: ACboy date: 2010-3-17 result: AC desecription: UVa 10167 - Birthday Cake*/#include using namespace std;struct TPoint{ int x; int y;};TPoint data[110];原创 2010-03-17 21:23:00 · 1088 阅读 · 0 评论 -
UVa 131 The Psychic Poker Player
枚举子集+恶心的模拟/* coder: ACboy date: 2010-3-18 result: 1A description: UVa 131 The Psychic Poker Player*/#include using namespace std;struct cards { int value; char a; char type原创 2010-03-18 22:47:00 · 1508 阅读 · 0 评论 -
UVa 216 Getting in Line
旅行商TSP(traveling salesmen problem)是一个NP难问题,至今没有有效的解决方案。本问题的规模为8!= 40320种可能,故使用枚举解决,这里枚举通过使用STL的next_permutation()函数来实现。AC代码如下:/* coder: ACboy date: 2010-3-19 result: AC description: UVa 216原创 2010-03-19 15:19:00 · 1298 阅读 · 0 评论 -
UVa 639 Don't Get Rooked
/* coder: ACboy date: 2010-3-19 result: 1A description: UVa 639 Dont Get Rooked*/#include using namespace std;char chess[4][4];char tempChess[4][4];int everyPos[70000][16];i原创 2010-03-19 19:53:00 · 968 阅读 · 0 评论 -
UVa 193 - Graph Coloring(graph theory, brute force, backtracking, NP-complete, maximum independent set.)
最近为感情问题纠结了很久,好久没AC了,早上起来回味了一下AC的感觉。哈哈/* File: vc193.cpp Author: ACboy Date: 2010-3-29 Result: AC Description: UVa 193 - Graph Coloring*/#include using namespace std;int data[11原创 2010-03-29 09:34:00 · 1891 阅读 · 0 评论 -
UVa 10082 WERTYU
/* File: 10082.cpp Author: ACboy Date: 2010-3-29 Result: AC Descripition: UVa 10082 WERTYU*/#include int main(){ #ifndef ONLINE_JUDGE freopen("10082.txt", "r", stdin);#en原创 2010-03-30 14:25:00 · 1577 阅读 · 0 评论 -
UVa 10405 Longest Common Subsequence
/* Author: ACboy Date: 2010-5-19 Result: AC Descripition: UVa 10405 Longest Common Subsequence*/#include using namespace std;char str[2][1100];int d[1100][1100];int get_max(i原创 2010-05-19 22:08:00 · 1073 阅读 · 0 评论 -
UVa 103 Stacking Boxes
/* Author: ACboy Date: 2010-5-19 Result: AC Descripition: UVa 103 Stacking Boxes*/#include #include using namespace std;//邻接矩阵int g[40][40];//记录每条边int edg[35][15];//dp数组i原创 2010-05-19 21:11:00 · 1136 阅读 · 0 评论 -
UVa 10003 Cutting Sticks
题目是经典DP,和矩阵相乘的最小乘法次数那个是一样的 f[i,j]=min{f[i,k]+f[k,j]}+j-i (k是i,j之间的木棍切割点) f[0,L]就是答案。由于划分阶段貌似比较困难,于是毫不犹豫的使用记忆化搜索开始的时候f数组开了1000*1000(由于L最大为1000),然后转移状态的时候从把所有的切割点过一遍,复杂度是O(kn^2),k于是提交,居然TLE原创 2010-05-20 21:14:00 · 1927 阅读 · 0 评论 -
UVa 10131 Is Bigger Smarter?
/* Author: ACboy Date: 2010-5-20 Result: AC Descripition: UVa 10131 Is Bigger Smarter?*/#include #include using namespace std;struct elephant { int w; int iq; int order;}原创 2010-05-20 19:27:00 · 1462 阅读 · 0 评论 -
UVa 10034 Freckles
/* Author: ACb0y Date: 2010-5-22 Result: AC Descripition: UVa 10034 Freckles(mst)*/#include #include using namespace std;double INF = 1 << 30;struct point { double x; dou原创 2010-05-22 09:58:00 · 622 阅读 · 0 评论 -
UVa 10034 Freckles
/* Author: ACb0y Date: 2010-5-22 Result: AC Descripition: UVa 10034 Freckles(mst)*/#include #include using namespace std;double INF = 1 << 30;struct point { double x; dou原创 2010-05-22 10:00:00 · 712 阅读 · 0 评论 -
UVa 10034 Freckles
/* Author: ACb0y Date: 2010-5-22 Result: AC Descripition: UVa 10034 Freckles(mst)*/#include #include using namespace std;double INF = 1 << 30;struct point { double x; dou原创 2010-05-22 09:57:00 · 952 阅读 · 0 评论 -
UVa 123 Searching Quickly
水题不解释/* Author: ACb0y Date: 2010-11-8 Type: water~~ ProblemId: UVa 123 Searching Quickly Result: 8381985 123 Searching Quickly Accepted C++ 0.020 2010-11-08 07:06:11*/#include #include #include #include #include #include using nam原创 2010-11-08 15:22:00 · 1136 阅读 · 0 评论 -
Uva 621 Secret Research
<br />/* Author: ACb0y Date: 2010-11-8 Type: Water~~ ProblemId: Uva 621 Secret Research Result: 8382071 621 Secret Research Accepted C++ 0.012 2010-11-08 08:08:34*/#include <iostream>using namespace std;//定义一个函数指针类型typedef bool (*fun)(s原创 2010-11-08 16:27:00 · 934 阅读 · 0 评论 -
UVa 10004 Bicoloring
/* File: 10004.cpp Author: ACboy Date: 2010-4-26 Result: 1A Descripition: UVa 10004 Bicoloring*/#include using namespace std;int edges[210][210]; /* adjacency information */int原创 2010-04-26 23:08:00 · 1021 阅读 · 0 评论 -
UVa 10006 Carmichael Numbers
/* File: 10006.cpp Author: ACboy Date: 2010-4-22 Result: AC Descripition: UVa 10006 Carmichael Numbers*/#include using namespace std;int vis[70000];// 快速幂取模(a^b % n)unsigne原创 2010-04-22 15:19:00 · 1166 阅读 · 0 评论 -
UVa 10139 Factovisors
/* File: 10139.cpp Author: ACboy Date: 2010-4-22 Result: AC Descripition: UVa 10139 Factovisors*/#include #include #include #include using namespace std;map m;set s;/原创 2010-04-23 12:34:00 · 1787 阅读 · 3 评论 -
UVa 10252 Common Permutation
/* File: 10252.cpp Author: ACboy Date: 2010-3-29 Result: 1A Descripition: UVa 10252 Common Permutation*/#include #include using namespace std;int main(){#ifndef ONLINE_JUDG原创 2010-03-30 14:29:00 · 962 阅读 · 0 评论 -
UVa 850 Crypt Kicker II
/* File: 850.cpp Author: ACboy Date: 2010-3-30 Result: AC Descripition: UVa 850 Crypt Kicker II */#include using namespace std;char s[] = "the quick brown fox jumps over the lazy原创 2010-03-31 11:51:00 · 2233 阅读 · 0 评论 -
UVa 10132 - File Fragmentation
/* File: 10132.cpp Author: ACboy Date: 2010-3-31 Result: 1A Descripition: UVa 10132 - File Fragmentation*/#include using namespace std;char data[150][260];int cmp(const void原创 2010-03-31 13:36:00 · 2360 阅读 · 5 评论 -
UVa 10041 Vito's Family (median selection)
/* File: 10041.cpp Author: ACboy Date: 2010-3-31 Result: AC Descripition: UVa 10041 Vitos Family (median selection)*/#include #include using namespace std;int data[30100];原创 2010-03-31 21:09:00 · 1019 阅读 · 0 评论