#include <stdio.h>
#include <stdlib.h>
char s[31];
int hash()
{
int sum = 0, i, k;
for (i = 0, k = 0;k < 7;i++) {
if (s[i] >='0' && s[i] <='9') {
sum *= 10;
k++;
sum += (s[i] - '0');
} else if (s[i] >='A' && s[i] < 'Z') {
sum *= 10;
k++;
sum += ((s[i] - 'A' - (s[i] > 'Q')) / 3 + 2);
}
}
return sum;
}
int mycompare(const void *a, const void *b)
{
return (*(int*)a - *(int*)b);
}
int main(void)
{
int len, i, num;
int *data = NULL;
int flag = 0;
scanf("%d",&len);
data = (int*)malloc(len*sizeof(int));
for (i = 0;i < len;i++) {
scanf("%s",s);
data[i] = hash();
}
qsort(data,len,sizeof(int),mycompare); /* It is API in stdlib */
for (i = 0,num = 1;i < len;i+=num=1) {
while (data[i] == data[i+1]) {
num++;
i++;
}
if (num > 1) {
printf("%03d-%04d %d\n", data[i]/10000, data[i]%10000, num);
flag = 1;
}
}
if (flag == 0)
printf("No duplicates.\n");
free(data);
return 0;
}
分享到:
相关推荐
DayOne CLI Better Touch Tool创建DayOne日记条目我创建了一个更好的触摸工具键盘快捷键,以将突出显示的文本保存到DayOne日记中。 我一直在使用它来保存文本片段以供以后使用。 我喜欢DayOne如何将当前日期和时间...
Applications targeting 64-bit experience better performance with larger available memory allocation. This means you can process larger datasets into charts and grids more efficiently because a 64-bit...
Applications targeting 64-bit experience better performance with larger available memory allocation. This means you can process larger datasets into charts and grids more efficiently because a 64-bit...
Applications targeting 64-bit experience better performance with larger available memory allocation. This means you can process larger datasets into charts and grids more efficiently because a 64-bit...
### CRISPRi:超越CRISPR-Cas9的技术 #### 概述 CRISPRi(CRISPR interference)是一种基于CRISPR系统的基因编辑技术,它在精确度、效率以及灵活性上相较于传统的CRISPR-Cas9系统有所提升。CRISPRi通过抑制而非...
Can now show Progress lines for individual tasks, which allows end-users to better monitor tasks that are ahead or behind schedule. Scheduler With the Scheduler control, you can now view the next ...
Applications targeting 64-bit experience better performance with larger available memory allocation. This means you can process larger datasets into charts and grids more efficiently because a 64-bit...
Can now show Progress lines for individual tasks, which allows end-users to better monitor tasks that are ahead or behind schedule. Scheduler With the Scheduler control, you can now view the next ...
Averaged One-Dependence Estimators (AODE) is one of supervised learning algorithm, which relaxes the conditional independent assumption that working on the standard naive Bayes learner. The AODE has ...
Can now show Progress lines for individual tasks, which allows end-users to better monitor tasks that are ahead or behind schedule. Scheduler With the Scheduler control, you can now view the next ...
Based on our popular HTML5 tools in Wijmo and designed to enhance the rich user experience of the Windows 8 platform, these controls... help you build better and more compelling Windows Store apps....
Earthworms can aerate the soil with their burrowing action and enrich the soil with ... The results show that EWA23 performs the best and it can find the better fitness on most benchmarks than others.
自述文件在EMNLP 2020上,与论文“两个优于一个”相关的代码:使用表序列编码器的联合实体和关系提取纳维资源数据集位于“ ./datasets/”中。由于版权问题,我们无法直接发布ACE数据集,而是将其预处理脚本放在“ ./...
使用rclone cleanup OneDrive:/path better new 自 rclone v1.52。 这个项目从现在开始被弃用并存档 OneDrive 版本历史清理器 Rhilip 的 PowerShell 脚本 MOD。 !!! 注意所有版本历史将在没有确认的情况下删除...
例如:"Mary's handwriting is far better than that of Peter." 和 "These pictures are more beautiful than those." 6. **One** 可以代替事物,也可以代替人,而 "that" 仅能代替事物。有时候可以用 "the one" ...
ComponentOne Studio for WinRT XAML2012 v3 Powerful WinRT XAML controls for building better Windows Store apps. Powerful UI and Data Visualization Controls for the Windows Store Get UI controls ...
There should be one-- and preferably only one --obvious way to do it. Although that way may not be obvious at first unless you're Dutch. Now is better than never. Although never is often better ...
There should be one-- and preferably only one --obvious way to do it. Although that way may not be obvious at first unless you're Dutch. Now is better than never. Although never is often better than *...
Designed to enhance the rich user experience of the Windows Phone 8, these Silverlight controls give you powerful and unique functionality to help you build better and more compelling apps. ...