http://codeforces.com/problemset/problem/520/C

题解:思维+数学+快速幂

/*
*@Author:   STZG
*@Language: C++
*/
#include <bits/stdc++.h>
#include<iostream>
#include<algorithm>
#include<cstdlib>
#include<cstring>
#include<cstdio>
#include<string>
#include<vector>
#include<bitset>
#include<queue>
#include<deque>
#include<stack>
#include<cmath>
#include<list>
#include<map>
#include<set>
//#define DEBUG
#define RI register int
#define endl "\n"
using namespace std;
typedef long long ll;
//typedef __int128 lll;
const int N=100000+10;
const int M=100000+10;
const int MOD=1e9+7;
const double PI = acos(-1.0);
const double EXP = 1E-8;
const int INF = 0x3f3f3f3f;
int t,n,m,k,p,l,r,u,v;
int ans,cnt,flag,temp,sum;
char str[N];
int a[5];
struct node{};
ll POW(ll a,ll b=MOD-2,ll c=MOD){ll res=1;ll base=a%c;while(b){if(b&1)res=(res*base)%c;base=(base*base)%c;b>>=1;}return res;
}
int main()
{
#ifdef DEBUGfreopen("input.in", "r", stdin);//freopen("output.out", "w", stdout);
#endif//ios::sync_with_stdio(false);//cin.tie(0);//cout.tie(0);//scanf("%d",&t);//while(t--){scanf("%d",&n);scanf("%s",str);for(int i=0;i<n;i++){if(str[i]=='A')a[0]++;if(str[i]=='C')a[1]++;if(str[i]=='G')a[2]++;if(str[i]=='T')a[3]++;}sort(a,a+4);for(int i=0;i<4;i++){if(a[i]==a[3])cnt++;}cout<<POW(cnt,n)<<endl;//}#ifdef DEBUGprintf("Time cost : %lf s\n",(double)clock()/CLOCKS_PER_SEC);
#endif//cout << "Hello world!" << endl;return 0;
}

DNA Alignment相关推荐

  1. 【CodeForces - 520C】DNA Alignment (快速幂,思维)

    题干: Vasya became interested in bioinformatics. He's going to write an article about similar cyclic D ...

  2. CodeForces - 520C DNA Alignment(思维)

    题目链接:点击查看 题目大意:给出定义函数h(s,t),其值等于字符串s和字符串t中相同字符的位置的个数,再给出一个函数p(s,t),简单来说就是一个二重循环,每次让字符串的第一个元素移到最后一个元素 ...

  3. 2017寒假练习题解 第四周 2.6-2.12

    2.6 Problem A Quasi Binary 题意:给出 n ,输出n至少由k个只含 01的数组成 简析:按照 n 的位数如果相应的一位不是0的话,就填 1 ,再减去,直到减到 n 为0 1 ...

  4. Codeforces Round #295 (Div. 2) ABC

    A - Pangram :判断一个字符串中有木有出现过26个字母,不论大小写,有YES没有NO #include <map> #include <set> #include & ...

  5. 机器学习在生物信息(如DNA比对等方面)的研究现状是怎样的?

    机器学习在生物信息(如DNA比对等方面)的研究现状是怎样的? 计算机研一小白一枚,实验室整体做的方向是机器学习,老板分给我的方向是机器学习在生物信息领域的应用.这方面我搜了些论文,但基本都是比较偏生物 ...

  6. Basic local alignment search tool (BLAST)

    Basic local alignment search tool (BLAST) 包括:blastn, blastp, blastx, tblastn, tblastx等. 使用conda安装即可. ...

  7. Efficient local alignment discovery amongst noisy long reads

    有效的局部比对发现在嘈杂的长读 Long read sequencers portend the possibility of producing reference quality genomes ...

  8. A Comprehensive Analysis of Sequence Alignment Algorithms for LongRead Sequencing

    A Comprehensive Analysis of Sequence Alignment Algorithms for LongRead Sequencing   长Read序列比对算法的综合分析 ...

  9. Denoising DNA deep sequencing data—high-throughput sequencing errors and their correction

    去噪DNA深度测序数据,高通量测序误差及其校正 Abstract 描述常见高通量测序平台产生的错误并从技术人工制品中识别出真正的遗传变异是两个相互依赖的步骤,对许多分析如单核苷酸变异调用.单倍型推断. ...

最新文章

  1. 微信架构 支付架构(下)
  2. 厦大计算机学硕考研复试,【图片】一战厦大计算机上岸,经验帖。慢更【考研吧】_百度贴吧...
  3. 【原】开源——基于文件驱动的站点开发
  4. cocos2dx对所有子节点设置透明度
  5. java的actionevent_[java]ActionEvent事件:获取输入字符串的长度
  6. Java异常处理基础
  7. Node.js 部署免费/自动续订 HTTPS
  8. 工业交换机和工业路由器的区别
  9. MySQL/sqlserver查询in操作 查询结果按in集合顺序显示
  10. oracle 创建模式语句,ORACLE基本使用SQL语句以及归档模式的操作
  11. WebAssembly 技术汇总
  12. github随时同步代码_原来用IntelliJ IDEA操作GitHub这么方便啊
  13. java bcd码_java中BCD编码
  14. Idea部署web项目 与 eclipse 的不同之处
  15. 【学术工具】公式免费转 LaTex 代码,截图、转换一气呵成,每月 1000 次全免费...
  16. liunx中常用命令 -大数据
  17. 注册(二)之增加绑定
  18. 基于Docker搭建Gitlab
  19. HTML实现百度换肤
  20. 凡刻(Fenke)FK169机械手表测评

热门文章

  1. pwm一个时间单位_解读:什么是PWM“死区”?
  2. python configparse_python中ConfigParse模块的用法
  3. ogr 缓冲区_GDAL的几何操作
  4. 过河问题matlab建模,matlab三对夫妻过河问题
  5. node sqlite 插入数据_使用 Sequelize 操作 Sqlite3 数据库
  6. shiny 发布部署到公开网站 ,供别人访问
  7. 八十六、推荐组件的redux-thunk异步解决方案、Ajax获取推荐数据
  8. 八、Flume的构架,安装和基本使用
  9. 八十、 Springboot整合异步任务和定时任务
  10. 活动报名 | PaddlePaddle Hackathon飞桨黑客马拉松邀你参加