上一页 1 ··· 23 24 25 26 27 28 29 30 31 ··· 182 下一页
摘要: 简单题View Code #include <iostream>#include <cstdlib>#include <cstdio>#include <cstring>using namespace std;#define maxn 20int n;int f[maxn];void input(){ n = 0; while (scanf("%d", &f[n]), f[n]) { if (f[n] == -1) exit(0); n++; }}void work(){ int ans = 0; for (... 阅读全文
posted @ 2013-04-03 17:02 undefined2024 阅读(429) 评论(0) 推荐(0) 编辑
摘要: 简单题View Code #include <iostream>#include <cstdlib>#include <cstdio>#include <cstring>#include <algorithm>using namespace std;#define maxn 15struct Student{ int v; char name[10];}stu[maxn];int n;bool operator < (const Student &a, const Student &b){ return a.v 阅读全文
posted @ 2013-04-03 14:24 undefined2024 阅读(245) 评论(0) 推荐(0) 编辑
摘要: 简单题View Code #include <iostream>#include <cstdio>#include <cstdlib>#include <cstring>using namespace std;int main(){ int t; scanf("%d", &t); while (t--) { int n; scanf("%d", &n); int ans = (1 + n / 2 - 1) * (n / 2 - 1) / 2 * 2; if (n & 1) ans + 阅读全文
posted @ 2013-03-27 16:41 undefined2024 阅读(214) 评论(0) 推荐(0) 编辑
摘要: 递推View Code import java.math.BigInteger;import java.util.Scanner;public class Main { public static void main(String[] args) { Scanner cin = new Scanner(System.in); while (true) { int n, m; m = cin.nextInt(); n = cin.nextInt(); if (n == 0 &... 阅读全文
posted @ 2013-03-27 14:58 undefined2024 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 用dp的方法n^2。用树状数组应该是n^2logn。View Code #include <iostream>#include <cstring>#include <cstdlib>#include <cstdio>using namespace std;#define maxn 105int n;int map[maxn][maxn];int row, col;int sx, sy;int f[maxn][maxn];void input(){ memset(map, 0, sizeof(map)); scanf("%d%d" 阅读全文
posted @ 2013-03-27 13:45 undefined2024 阅读(490) 评论(0) 推荐(0) 编辑
上一页 1 ··· 23 24 25 26 27 28 29 30 31 ··· 182 下一页