题目链接: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; } in…
DNA Sorting Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 77786 Accepted: 31201 Description One measure of ``unsortedness'' in a sequence is the number of pairs of entries that are out of order with respect to each other. For ins…
DNA Sorting Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 80832 Accepted: 32533 Description One measure of ``unsortedness'' in a sequence is the number of pairs of entries that are out of order with respect to each other. For instanc…
一. 题目 DNA Sorting Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 95052 Accepted: 38243 Description One measure of ``unsortedness'' in a sequence is the number of pairs of entries that are out of order with respect to each other. For i…
题目链接:http://poj.org/problem?id=1007 本题属于字符串排序问题.思路很简单,把每行的字符串和该行字符串统计出的字母逆序的总和看成一个结构体.最后把全部行按照这个总和从小到大排序即可. #include <iostream> #include <algorithm> using namespace std; struct DNA { ]; int count; } d[]; int cmp(DNA a, DNA b) { return a.count…