摘要: 题目链接用优先队列,特别方便。 1 #include <iostream> 2 #include <cstdio> 3 #include <queue> 4 #include <vector> 5 #include <algorithm> 6 using namespace std; 7 int main() 8 { 9 int n,i;10 __int64 sum,a,b;11 scanf("%d",&n);12 priority_queue< __int64 ,vector<__int64& 阅读全文
posted @ 2012-07-23 13:21 Naix_x 阅读(190) 评论(0) 推荐(0) 编辑
摘要: 练习STL中的map。 1 #include <iostream> 2 #include <cstdio> 3 #include <cstring> 4 #include <map> 5 using namespace std; 6 map <string,int> p; 7 int main() 8 { 9 int i,j,len,z;10 char str[101];11 char o[4];12 while(scanf("%s",str)!=EOF)13 {14 if(str[0] == '*' 阅读全文
posted @ 2012-07-23 13:02 Naix_x 阅读(180) 评论(0) 推荐(0) 编辑