UVaOJ
ShellDawn
Gu-Ah
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Uva 253 (implement)
/* * 20171119 */#include <cstdio> #include <cstring>int e[10][10];int main() { //freopen("input.txt","r",stdin); //freopen("ans.txt","w",stdout); memset(e,0,sizeof(e)); e[1][2] = e[2][1原创 2017-11-19 23:17:23 · 321 阅读 · 0 评论 -
UVa1590 找最小子网掩码,和子网ip
/* * 20171214 *//* 注意: 1,数字没有前导零,数字长度不一; 2,数字会出现0的情况; 3,注意初始化数组,因为要用0来结束字符串; */#include <cstdio> #include <cstring> #include <algorithm>using namespace std;#define maxn 1005char str[maxn][40]; int m;in原创 2017-12-14 19:40:23 · 1118 阅读 · 0 评论 -
UVa 1587 (运算符重载)
/* * 20170802 */ #include <cstdio> #include <algorithm> #include <cstdlib>using namespace std;struct Pallet { public: int l; int w; public: void init(int a,int b){l=max(a,b);w=min(a,b);}原创 2017-08-02 21:34:21 · 602 阅读 · 0 评论 -
UVa 202 (分数最小循环节)
记一点经验吧: 写程序之前要明确每个变量所代表的意义。 不要急于写程序,最好能手动实现后再写程序。 写程序最好一气呵成。/* * 20170801 */ #include <cstdio> #include <cstring> #include <algorithm> #include <map> #include <queue>using namespace std;map<int,int>原创 2017-08-01 20:22:03 · 356 阅读 · 0 评论 -
UVa 11809 (math)
很有意思的一道题,正向做非常麻烦,逆向做打表比较简单/* * 20170909 */#include <cstdio> #include <cstring> #include <algorithm> #include <cmath> #include <cstdlib>using namespace std;//鉴别精度由打表分析看出的 #define eps 0.0001double ans[3原创 2017-09-09 20:37:01 · 402 阅读 · 0 评论 -
UVa1339 (单向映射)
/* * 20170913 */#include <cstdio> #include <algorithm> #include <cstdlib> #include <cstring> #include <map>using namespace std;int main() { char a[105]; char b[105]; while(scanf("%s%s",a,b)原创 2017-09-13 15:53:50 · 353 阅读 · 0 评论 -
UVa489 (implement)
有一点注意的地方,就是在7次之内猜对后,接着错误超过7次也算win。/* * 20170913 */#include <cstdio> #include <cstring> #include <algorithm> #include <cstdlib> #include <map>using namespace std;int main() { int num = 0; while(原创 2017-09-13 17:15:10 · 369 阅读 · 0 评论 -
Uva 133 (implement)
使用数组模拟链表,有个A,B的删除先后顺序,如果A删了A后正好落在需要删除的B上,需要再进行一次判断。/* * 20171026 */#include <cstdio> #include <algorithm> #include <cstring>using namespace std;#define maxn 30int n,k,m; int v[maxn]; int left[maxn]; in原创 2017-10-28 11:40:48 · 276 阅读 · 0 评论 -
UVa 213 (implement)
一种哈希映射的方法,简化代码量。/* * 20171028 *///#define LOCAL#include <cstdio> #include <cstring> #include <algorithm>using namespace std;#define maxn 1000char code[8][1<<8]; char head[maxn];int readchar() { cha原创 2017-10-28 22:22:03 · 332 阅读 · 0 评论 -
UVa512 (implement)
AC代码:/* * 20171030 *///#define LOCAL#include <cstdio> #include <cstring> #include <algorithm> #include <cstdlib>using namespace std;#define maxn 10000struct Command { char s[5]; int r1,c1,r2,c2原创 2017-10-31 11:11:15 · 427 阅读 · 0 评论 -
Uva12412 (implement)
这里有个非常非常注意的点:对于浮点数运算,首先十分推荐用double,然后如果出现浮点数保留几位小数的情况,一定要在执行保留小数前另外加eps(精度容错)/* * 20171104 */#include <cstdio> #include <cstring>using namespace std;#define maxn 10000 #define eps 0.00001const char fna原创 2017-11-04 20:52:52 · 574 阅读 · 0 评论 -
UVa 1589 (implement)
思维失误了,是红子可以被吃掉,但被另外一个红字管辖就不能被吃。/* * 20171108 *///#define LOCAL //#define TEST#include <cstdio> #include <cstring> #include <algorithm>using namespace std;const int dx[] = {1,-1,-2,-2,-1,1,2,2}; const原创 2017-11-08 15:07:40 · 291 阅读 · 0 评论 -
UVa 201 (implement)
/* * 20171109 *///#define LOCAL#include <cstdio> #include <algorithm> #include <cstring>using namespace std;int num[10][10][10][10]; int ans[10]; int n;bool hline(int x,int y,int dx,int dy,int k) {原创 2017-11-09 15:45:50 · 284 阅读 · 0 评论 -
UVa 220 (implement)
找到了一个小bug,就是输出坐标时,会重复输出,后来加了getout控制就AC了。 写模拟题思维一定要严谨,代码严谨已读很重要/* * 20171109 *///#define LOCAL#include <cstdio> #include <cstring> #include <algorithm> #include <map>using namespace std;int dx[] = {-1原创 2017-11-09 19:23:00 · 456 阅读 · 0 评论 -
UVa 508 摩斯码匹配单词
/* * 20171215 *//* multi match ! need make up ? than same */#include <cstdio> #include <cstring> #include <algorithm>using namespace std;char sC[30][10]; char sN[20][10]; char ans[1000][1000]; char mtc原创 2017-12-15 15:35:37 · 406 阅读 · 0 评论
分享