摘要: map的用法:代码: 1 #include 2 #include 3 #include 4 #define maxn 1000009 5 using namespace std; 6 7 vectorve[maxn]; 8 map >mp; 9 int n,m,x,y;10 int main()11 {12 while(scanf("%d%d",&n,&m)!=EOF)13 {14 mp.clear();15 for(int i=0;i();19 mp[x].push_back(i+1);20 }21 ... 阅读全文
posted @ 2013-10-23 23:15 Yours1103 阅读(146) 评论(0) 推荐(0) 编辑
摘要: 题目很简单,就是不知道为啥总是runtime error;后来发现我是先判断的y!=p.front();应该先判断是否为空;哎!今天果然不宜A题啊!代码: 1 #include 2 #include 3 #include 4 using namespace std; 5 priority_queuepq; 6 queueq; 7 stacks; 8 bool flag[4]; 9 int main()10 {11 int n,x,y;12 while(scanf("%d",&n)!=EOF)13 {14 while(!q.empty())q.pop();... 阅读全文
posted @ 2013-10-23 22:57 Yours1103 阅读(182) 评论(0) 推荐(0) 编辑