10474 - Where is the Marble?
摘要:
排序,检索;使用 bsearch 的 cmp 不能只返回 -1 或 1 (可能是要用差进行比较);# include <stdio.h># include <stdlib.h># include <string.h># define N 10005int n, q, a[N], f[N];int cmp(const void *x, const void *y){return ( *(int*)x - *(int*)y );}int main(){ int i, cnt, x; cnt = 0; while (1) { scanf("%d%... 阅读全文
posted @ 2012-07-06 10:52 getgoing 阅读(246) 评论(0) 推荐(0)
浙公网安备 33010602011771号