- 博客(7)
- 收藏
- 关注
原创 UVa 10474 Where is the Marble?
挺简单的一道题,直接AC 用的是理扑克牌式的sorting方法,效率并不高,用时比较长 #include #include void sorting(int* in, int N); using namespace std; const int maxn = 10004; int in[maxn], fi[maxn]; int main() { int N, Q; int count =
2017-07-05 21:45:27
168
原创 UVa 1590 IP Networks
这是一道水题 然而wa无数遍 忘了写读取数据的循环 忘了写了循环后需要每次memset 忘了memset需要cstring头文件 没看到题目n的上限是1000 。。。 我就是个渣渣。。。 然而最后ac了呀,ac了呀。。 位操作可以轻松用于2进制转换 #include #include #include int in[1002][5], in2[1002][40], ans1[4
2017-06-12 17:59:59
252
原创 UVa 253 Cube painting
正常思路应该是列举所有的旋转情况再做判断 我的思路比较清奇。。。因为16,25,34相对,就像先把串分成两组,表示相对的2个顶点,将一个角与前面一一对应后再比较对面是否一样。 写起来也比较长?? //Cube painting #include char a[7], b[7]; int compare(int i, int j, int k); int check(int i, int j
2017-06-03 15:42:14
199
原创 UVa 220 Othello
这个题的思路也比较清晰,依然花了1个小时才把代码写出来,好在bug不多 //Othello #include #include using namespace std; char b[10][10]; int check(char type,int x,int y); char* move(int dir, int num,int x,int y); void M(char type, int
2017-06-03 11:01:28
275
原创 UVa 201 Squares
终于有一个简单题了,没话说 #include #include using namespace std; int H[10][10], V[10][10]; int ans[10]; int check(int i,int j,int n); int check(int i, int j, int n) { for (int m = i; m < i + n; m++) if (V[m][
2017-05-29 16:32:08
245
原创 UVa 512 Spreadsheet Tracking
题目意思就是对电子表格进行一系列操作后追踪各cell的去向,基本操作类型有EX DR DC IR IC 5种,关键是设计简单的基本操作函数。 sample input 7 9 5 DR 2 1 5 DC 4 3 6 7 9 IC 1 3 IR 2 2 4 EX 1 2 6 5 4 4 8 5 5 7 8 6 5 0 0 sample output Sp
2017-05-22 16:25:47
220
原创 UVa 213 Message Decoding
输入部分包含两部分,编码头和一串code,注意序列与编码头的对应关系中,序列有着很强的分段规律性,所以选择二维数组code储存,最后解码时直接输出对应code元素即可。 源码如下 #include #include const int maxn = 80; char code[8][1 << 8]; void readchar(); int readint(int c); int main()
2017-05-22 16:03:05
206
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人