摘要: 这个题目的意思是输入n个数,m组询问,每组询问包含两个整数k,v,意思是询问整数v第k次出现的位置。#include #include #include using namespace std;int main(){ map > mm; //我们这里使用了STL里的map和vector int n, m, k, v, i, a; while (scanf("%d%d",&n,&m) != EOF) { mm.clear(); for (i = 1;i <= n;i++) { scanf... 阅读全文
posted @ 2013-02-06 22:44 xindoo 阅读(122) 评论(0) 推荐(0) 编辑
摘要: 基础数据结构例题例题1UVa11995 ACI Can Guess the Data Structure!ADT题解例题2UVa11991 ACEasy Problem from Rujia Liu排序或者善用STL题解例题3LA3135 ACArgus优先队列;模拟题解例题4UVa11997 ACK Smallest Sums优先队列;有序表合并题解例题5LA3644 ACX-Plosives并查集 题解例题6LA3027 ACCorporative Network加权并查集 题解习题UVa11988ACBroken Keyboard (a.k.a. B... 阅读全文
posted @ 2013-02-06 22:27 xindoo 阅读(278) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionGiven two sequences of numbers : a[1], a[2], ...... , a[N], and b[1], b[2], ...... , b[M] (1 int n, m;int a[1000005];int b[10005];int f[10005];void getfail(){ f[0] = 0; f[1] = 0; for (int i = 1; i < m; i++) { int j = f[i]; while (j && b[i] != b[j]) ... 阅读全文
posted @ 2013-02-06 21:29 xindoo 阅读(109) 评论(0) 推荐(0) 编辑