摘要:
简单题View Code #include <iostream>#include <cstdio>#include <cstdlib>#include <cstring>using namespace std;string st[16];int length[16];char a[6000000];int getid(char *a){ int len = strlen(a); for (int i = 0; i <= 15; i++) if (len == length[i]) return i; return -1;}int main( 阅读全文
posted @ 2011-07-13 10:03
undefined2024
阅读(190)
评论(0)
推荐(0)
摘要:
简单题View Code #include <iostream>#include <cstdio>#include <cstdlib>#include <cstring>using namespace std;int n, m, c;int main(){ //freopen("t.txt", "r", stdin); while (scanf("%d%d%d", &n, &m, &c), n | m | c) { if ((n + m) & 1) c = 阅读全文
posted @ 2011-07-13 09:33
undefined2024
阅读(169)
评论(0)
推荐(0)
摘要:
题意,给定一个01矩阵,要求从0矩阵变换得到该结果,变换的方法是把一个绝对r*c大小的方格内的元素改变(0变1,1变0)。最少多少步。分析:我们可以知道如果想改变左上角的方格内的元素,则方法只有一种,即最左上角的r*c是否改变是确定的。在操作完成后,想改变第二行第一列以及第一行第二列的元素,并保持左上角元素不变的方法也分别只有一种。依次类推。可发现整个的方法是确定的。改变后判断结果与要求的结果是否相同即可。View Code #include <iostream>#include <cstdio>#include <cstdlib>#include < 阅读全文
posted @ 2011-07-13 08:37
undefined2024
阅读(437)
评论(0)
推荐(0)