摘要: 水题,但是要细心#include <stdio.h>#include <stdlib.h>#define N 10007int a[N], b[N];int cmp(const void * a, const void * b){ return *(int *)a - *(int *)b;}int main(){ int n, i; while(scanf("%d", &n) != EOF) { for(i = 0; i < n; i++) scanf("%d", &a[i]); qsort(a, n, si 阅读全文
posted @ 2011-08-06 09:08 AC_Von 阅读(283) 评论(0) 推荐(0) 编辑
摘要: 这题的数据有点问题,给的N个数里边最大的数是多少不知道,直接猜了个数用hash做了,居然1A了。。。。#include <stdio.h>#include <string.h>#define N 100007int hash[N];int main(){ int n, i, a; while(scanf("%d", &n) != EOF) { memset(hash, 0, sizeof(hash)); int max = -1; while(n--) { scanf("%d", &a); if(a > ma 阅读全文
posted @ 2011-08-06 08:24 AC_Von 阅读(229) 评论(0) 推荐(0) 编辑