poj 107 DNA sorting】的更多相关文章

关于Java的题解,也许效率低下,但是能解决不只是ACGT的序列字符串 代码如下: import java.util.*; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); TreeMap<Integer,String> map = new TreeMap<Integer,String>(); //读入题目所给的信息 int n = sc.…
    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…
DNA Sorting Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 95437   Accepted: 38399 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: 95209   Accepted: 38311 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…
题目链接: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…
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 instance, in the letter sequence ``DAABEC'', this measure is 5, since D is greater than four letters to…
#include<iostream>//写字符串的题目可以用这种方式:str[i][j] &str[i] using namespace std; int main() {int n,m,i,j,num,a[101],b[101],t,k; char str[101][51]; cin>>n>>m; for(i=0;i<m;i++) { cin>>str[i]; num=0; for(j=0;j<n-1;j++) for(k=j+1;k&…
DNA Sorting Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 88690 Accepted: 35644 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 instance, in…