POJ1007-DNA Sorting-ACM】的更多相关文章

[POJ1007]DNA Sorting 试题描述 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 fo…
这题比较简单,重点应该在如何减少循环次数. package practice; import java.io.BufferedInputStream; import java.util.Map; import java.util.Scanner; import java.util.TreeMap; /** * DNA sorting * * @author caiyu * @date 2014-11-5 */ public class POJ1007 { public static void m…
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…
DNA Sorting Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 114211   Accepted: 45704 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 instan…
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: 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…
点击打开链接 DNA Sorting Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 75164   Accepted: 30115 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…
一. 题目 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…
欢迎参加——BestCoder周年纪念赛(高质量题目+多重奖励) DNA Sorting Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 2182    Accepted Submission(s): 1062 Problem Description One measure of ``unsortedness'' in a sequenc…
    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: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 2329    Accepted Submission(s): 1145 Problem Description One measure of ``unsortedness'' in a sequence is the number of pairs of entr…
DNA Sorting Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 105159   Accepted: 42124 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 instan…
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 (题目链接) 题意 给出m个字符串,将其按照逆序对个数递增输出. Solution 树状数组经典应用. 代码 // poj1007 #include<algorithm> #include<iostream> #include<cstring> #include<cstdlib> #include<cstdio> #include<cmath> #include<st…
DNA排序 题目大意:给定多个ACGT序列,按照字母顺序算出逆序数,按逆序数从小到大排列 这题其实很简单,我们只要用一个归并排序算逆序数,然后快排就可以了(插入排序也可以,数据量不大),但是要注意的是他要保持原来的顺序,fcmop那里要写当a.inverse=b.inverse时,返回0 #include <iostream> #include <functional> #include <algorithm> using namespace std; typedef…
题目链接: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…
原题链接 题目大意:给定一串字符串,查找字符串里字母逆序排列的对数,按照由少到多的顺序把所有字符串进行排列. 解法:用C++字符串string类的iterator,从每个字符串的起始开始,查找逆序字符的个数,然后用qsort方法按照reverseCount的大小快速排序. 参考代码: #include<iostream> #include<string> #include<string.h> #include<cstdlib> #include<cst…
Problem 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 let…
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…
ACM训练联盟周赛 这一场有几个数据结构的题,但是自己太菜,不会树套树,带插入的区间第K小-替罪羊套函数式线段树, 先立个flag,BZOJ3065: 带插入区间K小值 计蒜客 Zeratul与Xor 赛后知道这是个01字典树的题目(嘤嘤嘤???) 这一场写了两道(具体来说就一道)就开溜了,但是计蒜客上这个比赛貌似没有赛后补题,但是有差不多的题目,所以去补那些题就可以了. 有题库链接,可以补题了. G. 算个欧拉函数给大家助助兴 这个题和上一场的 F.Divisions,其实就是一样的题目,代码…
#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&…
关于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.…
首先是昨天在北京大学oj网上看到一个简单的算法题目,虽然简单,但是如何完成一段高效.简洁.让人容易看懂的代码对于我这个基础不好,刚刚进入计算机行业的小白来说还是有意义的.而且在写代码的过程中,会发现自己平时学习中不会发现的问题,所以想写下这个博客,主要是便于自己对算法的理解. 来,上题. DNA Sorting Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 91599   Accepted: 36781 Descript…
DNA Sorting Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 2203    Accepted Submission(s): 1075 Problem Description One measure of ``unsortedness'' in a sequence is the number of pairs of entri…
 DNA Sorting Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 2357    Accepted Submission(s): 1158 Problem Description One measure of ``unsortedness'' in a sequence is the number of pairs of e…
acm之pku题目分类 对ACM有兴趣的同学们可以看看 DP:  1011   NTA                 简单题  1013   Great Equipment     简单题  1024   Calendar Game       简单题  1027   Human Gene Functions   简单题  1037   Gridland            简单题  1052   Algernon s Noxious Emissions 简单题  1409   Commun…
POJ 排序的思想就是根据选取范围的题目的totalSubmittedNumber和totalAcceptedNumber计算一个avgAcceptRate. 每一道题都有一个value,value = acceptedNumber / avgAcceptRate + submittedNumber. 这里用到avgAcceptedRate的原因是考虑到通过的数量站的权重可能比提交的数量占更大的权重,所以给acceptedNumber乘上了一个因子. 当然计算value还有别的方法,比如POJ上…
DNA Sorting Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 83442   Accepted: 33584 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: 83069 Accepted: 33428 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, i…