Chinaunix首页 | 论坛 | 博客
  • 博客访问: 125432
  • 博文数量: 31
  • 博客积分: 2010
  • 博客等级: 大尉
  • 技术积分: 275
  • 用 户 组: 普通用户
  • 注册时间: 2008-10-08 15:00
文章分类

全部博文(31)

文章存档

2009年(15)

2008年(16)

我的朋友

分类: C/C++

2009-03-19 10:14:40

#include
#include
#include
using namespace std;
string s,t;
map cnt;
int i,n,f;
int main()
{
 freopen("input.txt","r",stdin);
     cin>>n;
     while(n--)
     {
           cin>>s;
           f=0;
           for(i=0;i           {
                 if(s[i]=='-') continue;
                 else if(s[i]>='0'&&s[i]<='9') t.push_back(s[i]);
                 else if(s[i]>='A'&&s[i]<='P')
                 {
                       s[i]-='A';
                       s[i]/=3;
                       s[i]+='0'+2;
                       t.push_back(s[i]);
                 }
                 else
                 {
                       s[i]-='A'+1;
                       s[i]/=3;
                       s[i]+='0'+2;
                       t.push_back(s[i]);
                 }
           }
           t.insert(3,"-");
           ++cnt[t];
           t.clear();
     }
     for(map::iterator p=cnt.begin();p!=cnt.end();p++)
     {
           if(p->second>1)
           {
                 cout<first<<" "<second<                 f=1;
           }
     }
     if(!f)cout<<"No duplicates."<}
阅读(1193) | 评论(0) | 转发(0) |
0

上一篇:ACM POJ 1200

下一篇:ACM POJ 3299

给主人留下些什么吧!~~