http://codeforces.com/problemset/problem/4/C
来源:互联网 发布:公司网封端口 编辑:程序博客网 时间:2024/06/07 13:09
#include<iostream>#include<cstdio>#include<cstring>using namespace std;char str[100005][40];int fig[100005];int main(){ int n; while(scanf("%d",&n)!=EOF) { memset(fig,0,sizeof(fig)); for(int i=0;i<n;i++) { scanf("%s",str[i]); int k=0; int index=0; for(int j=0;j<i;j++) { if(strcmp(str[i],str[j])==0) { k=++fig[j]; index=j; break; } } if(k==0) printf("OK\n"); else printf("%s%d\n",str[i],fig[index]); } } return 0;}/*4abacabaacabaabacabaacab6firstfirstsecondsecondthirdthird*/
- http://codeforces.com/problemset/problem/4/C
- http://codeforces.com/problemset/problem/712/C
- http://codeforces.com/problemset/problem/4/A
- http://codeforces.com/problemset/problem/4/B
- http://codeforces.com/problemset/problem/237/C Primes on Interval
- http://codeforces.com/problemset/problem/714/C Sonya and Queries
- http://codeforces.com/problemset/problem/1/A
- http://codeforces.com/problemset/problem/228/A
- http://codeforces.com/problemset/problem/266/B
- http://codeforces.com/problemset/problem/236/A
- http://codeforces.com/problemset/problem/716/C Plus and Square Root
- Т-prime http://codeforces.com/problemset/problem/230/B
- dfs搜索练习题 http://codeforces.com/problemset/problem/589/J
- http://codeforces.com/problemset/problem/4/D Mysterious Present (簡單LIS)
- 欧拉路的判定 http://hihocoder.com/problemset/problem/1176
- http://codeforces.com/contest/276/problem/C
- http://codeforces.com/contest/366/problem/C之01背包
- http://212.193.33.23/problemset/problem/154/A
- 深入理解proc文件系统
- 原型继承
- HDU 1272 并查集
- Android APK反编译详解(附图)
- [其它软件] 【手机通过电脑上网】只需几分钟,让电脑变WIFI【图文】
- http://codeforces.com/problemset/problem/4/C
- 快速排序(QuickSort)
- solaris笔记5
- TextBox编辑框间的自动跳转C#实现
- ORA-00312
- 算法导论 9.1-1 求第二小元素
- 不错的技术博客汇总(持续更新)
- 联想E420麦克风没有声音的方案
- 分页式存储管理系统