百炼OJ - 1007 - DNA排序
2024-09-06 22:19:02
题目链接:http://bailian.openjudge.cn/practice/1007
#include<stdio.h>
#include<algorithm>
using namespace std;
typedef struct number{
char s[51];
int num;
};
int n,len;
number myn[101];
bool cmp( number a, number b )
{
return a.num < b.num;
}
int main()
{
scanf("%d %d",&len,&n);
for(int i=0;i<n;i++)
{
scanf("%s",myn[i].s);
myn[i].num = 0;
for(int j=0;j<len;j++)
{
if(myn[i].s[j] == 'A') continue;
for(int k=j+1;k<len;k++)
{
if(myn[i].s[j] > myn[i].s[k])
myn[i].num++;
}
}
}
sort(myn,myn+n,cmp);
for(int i=0;i<n;i++)
puts(myn[i].s);
return 0;
}
最新文章
- 专家解读:BPM与OA的区别
- SQL注入的常用函数和语句
- python redis使用
- CommonJS 模块规范 1.1.1
- cnblog code syntaxhighlighter view
- EXTJS 3.0 资料 控件之 FormPanel 插入button用法
- (转)Android’s HTTP Clients
- C/C++与lua实现互调
- C#打开php链接传参然后接收返回值
- mysql5.6.24的安装与简单使用
- jupyter的交互小工具-----ipyleaflet
- Python学习笔记【第三篇】:if判断、while循环、for循环
- linux 扩展根分区
- mongodb数据库安装及常见操作
- spirngboot 注解方式注入自定义参数
- alitomcat maven以及Autoconfig
- ubuntu下安装和配置最新版JDK8傻瓜教程
- WebApi跨域问题解决
- 破解Power Designer 12.5
- Linux操作系统下的三种Java环境配置方法
热门文章
- Windows2008r2、正版安装包
- 如何处理pom文件中没有找到HUB检查到高危漏洞的依赖包
- Alice and Hairdresser
- PP: Shallow RNNs: a method for accurate time-series classification on tiny devices
- chrome js报错Uncaught SyntaxError: Unexpected string
- python3函数的参数
- 全面了解 Java 原子变量类
- c语言 memcpy()
- java高精度,大数
- Django | Unable to get repr for <;class &#39;django.db.models.query.QuerySet&#39;>;