摘要:
Othello我的这道题的代码还是比较简洁的哈哈。version 1:#include#includeusing namespace std;int n,wn,bn;int dxs[3] = {0,1,-1};int dys[3] = {0,1,-1};char c,... 阅读全文
摘要:
IP Networks注意单个IP地址及网络地址后面加 .0 的情况(cnt #includeusing namespace std;const int maxn = 1000 + 5;int n,num[maxn][4];int main(){ while(s... 阅读全文
摘要:
253:Cube painting开始的想法:骰子无论怎么转,每个数字和其对面的数字的对应关系永远不会改变,所以只需要比较两个骰子的三对数字是否相同即可,也的确AC了,但是后来想想不太对。#include#includeusing namespace std;char... 阅读全文
摘要:
和 0 - 1 背包的区别是每种物品可以选任意多个。dp[i+1][j] = 从前 i 种物品中挑选总重量不超过 j 时总重量的最大值。递推关系为:dp[0][j] = 0dp[i+1][j] = max{ dp[i][j - k*w[i]] + k*v[i] | ... 阅读全文
摘要:
UVa - 512 Spreadsheet Tracking思路1:首先模拟操作,算出最后的电子表格,然后在每次查询时直接在电子表格中找到所求的单元格。#include#includeusing namespace std;const int maxn = 100,b... 阅读全文
摘要:
Some message encoding schemes require that an encoded message be sent in two parts. The first part, called the header, contains the ch... 阅读全文
摘要:
The Dole Queue Time limit: 3.000 secondsIn a serious attempt to downsize (reduce) the dole queue, The New National Green Labour Rhinoc... 阅读全文
摘要:
489 - Hangman JudgeTime limit: 3.000 secondshttp://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=94&page=show... 阅读全文
摘要:
Ancient CipherTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 36467 Accepted: 11879DescriptionAncient Roman empire had a str... 阅读全文
摘要:
Cash MachineTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 38756 Accepted: 14102DescriptionA Bank plans to install a machin... 阅读全文