上一页 1 ··· 20 21 22 23 24 25 26 27 28 ··· 182 下一页
摘要: 最短路map如果要使用char*作为key,不能简单的直接使用,可以用string作为map的key,使用的时候将char*转换为string。转换的方法是使用string的assign函数。string.assign(char*);#include <iostream>#include <cstdlib>#include <cstdio>#include <cstring>#include <algorithm>#include <map>using namespace std;#define maxn 205#defi 阅读全文
posted @ 2013-06-11 22:34 undefined2024 阅读(229) 评论(0) 推荐(0)
摘要: 简单题#include <iostream>#include <cstdlib>#include <cstdio>#include <cstring>using namespace std;#define maxn 105int n;int sum_row[maxn];int sum_col[maxn];int f[maxn][maxn];void input(){ for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) scanf("%d", &f[ 阅读全文
posted @ 2013-06-08 19:39 undefined2024 阅读(187) 评论(0) 推荐(0)
摘要: 简单题#include <iostream>#include <cstdlib>#include <cstring>#include <cstdio>using namespace std;int a, b, c, d;int cal(int a){ return (a + 40) % 40;}int main(){ while (scanf("%d%d%d%d", &a, &b, &c, &d), a | b | c | d) { int ans = cal(a - b) + cal(c - 阅读全文
posted @ 2013-06-07 22:17 undefined2024 阅读(161) 评论(0) 推荐(0)
摘要: 简单题#include <iostream>#include <cstdlib>#include <cstdio>#include <cstring>using namespace std;#define maxn 1005int n;int f[maxn];double average;void input(){ int sum = 0; scanf("%d", &n); for (int i = 0; i < n; i++) { scanf("%d", &f[i]); sum += 阅读全文
posted @ 2013-06-07 21:07 undefined2024 阅读(164) 评论(0) 推荐(0)
摘要: 简单题#include <iostream>#include <cstdlib>#include <cstdio>#include <cstring>using namespace std;#define maxn 1000005char st[maxn];int len;bool ok(int a){ for (int i = a; i < len; i++) if (st[i] != st[i % a]) return false; return true;}int work(){ for (int i = 1; i <= len 阅读全文
posted @ 2013-06-07 17:01 undefined2024 阅读(199) 评论(0) 推荐(0)
上一页 1 ··· 20 21 22 23 24 25 26 27 28 ··· 182 下一页