繁华模拟赛 David与阶乘



#include<cstdio>
#include<iostream>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<vector>
#include<queue>
#include<map>
#include<set>
#include<stack>
#include<cstdlib>
#include<string>
#include<bitset>
#define INF 100000000
#define fi first
#define se second
#define debug(x) cout<<#x<<"="<<x<<endl
using namespace std;
typedef long long LL;
typedef pair<int,int> pii;
int c[][],a[];
char s[];
int main()
{
freopen("david.in","r",stdin);
freopen("david.out","w",stdout);
c[][]=;
c[][]=;
c[][]=,c[][]=;
c[][]=;
c[][]=,c[][]=;
c[][]=;
c[][]=,c[][]=;
c[][]=,c[][]=,c[][]=;
int n,i,j;
cin>>n;
scanf("%s",s+);
for(i=;i<=n;i++)
{
for(j=;j<=;j++)
a[j]+=c[s[i]-][j];
}
for(j=;j;j--)
while(a[j])
printf("%d",j),a[j]--;
cout<<endl;
return ;
}
// davidlee1999WTK 2015/
// srO myk Orz
//ios::sync_with_stdio(false);
繁华模拟赛 David与阶乘的更多相关文章
- 繁华模拟赛 David与Vincent的博弈游戏
#include<iostream> #include<cstdio> #include<string> #include<cstring> #incl ...
- [繁华模拟赛]Evensgn 剪树枝
Evensgn 剪树枝 题目 繁华中学有一棵苹果树.苹果树有 n 个节点(也就是苹果),n − 1 条边(也就 是树枝).调皮的 Evensgn 爬到苹果树上.他发现这棵苹果树上的苹果有两种:一 种是 ...
- 繁华模拟赛day8 牛栏
/* 标称并没有用到题解中提到的那种奇妙的性质,我们可以证明,正常从1开始走的话,需要T次,如何使这个次数减小?题解中提到一个办法,有一步小于n/t,我们考虑这一步,如果把它匀到左右两步中,则可以减小 ...
- 繁华模拟赛day8 字典序
/* 这个题要我们求一个字典序,字符串给出的顺序,会对字母的字典序前后相对顺序进行限定,如何用来表示这种限定,我们注意到这种一个之后接着一个,只有先输出他前面的才能输出他,很明显就是拓扑排序,最小方案 ...
- 繁华模拟赛day8 科技树
/* 贪心,很明显是越容易升级的越先升级 */ #include<iostream> #include<cstdio> #include<string> #incl ...
- 繁华模拟赛 Vicent坐电梯
/*n<=5000这样就不能用O(n)的转移了,而是要用O(1)的转移.注意我们每次的转移都来自一个连续的区间,而且我们是求和区间求和?前缀和!令sum[step][i]表示f[ste ...
- 繁华模拟赛 Vincent的城堡
#include<iostream> #include<cstdio> #include<string> #include<cstring> #incl ...
- 繁华模拟赛 vicent的字符串
#include<iostream> #include<cstdio> #include<string> #include<cstring> #incl ...
- 繁华模拟赛 Evensgn剪树枝
#include<iostream> #include<cstdio> #include<string> #include<cstring> #incl ...
随机推荐
- python中的内置函数getattr()
在python的官方文档中:getattr()的解释如下: getattr(object, name[, default]) Return the value of the named attribu ...
- 使用线程池模拟处理耗时任务,通过websocket提高用户体验
前言 在文章开始之前,询问一下大家平时工作中后端处理批量任务(耗时任务)的时候,前端是如何告知用户任务的执行情况的? 楼主对这个问题想了下,决定使用websokect将这一过程展现给用户. 于是就有了 ...
- 使用Let’s Encrypt轻松配置https站点
使用Let's Encrypt轻松配置https站点 https不仅能提高网站安全,更是被搜索引擎纳入排名的因素之一. 2015年10月份,微博上偶然看到Let's Encrypt 推出了beta版, ...
- ASP.NET MVC5 插件化机制简单实现
一.前言 nopCommerce的插件机制的核心是使用BuildManager.AddReferencedAssembly将使用Assembly.Load加载的插件程序集添加到应用程序域的引用中.具体 ...
- AngularJS开发指南16:AngularJS构建大型Web应用详解
AngularJS是由Google创建的一种JS框架,使用它可以扩展应用程序中的HTML功能,从而在web应用程序中使用HTML声明动态内容.在该团队工作的软件工程师Brian Ford近日撰写了一篇 ...
- JS模式:jq中简单的模式--》采摘自js设计(tomxu_version)
<!DOCTYPE html> <html> <head> <title></title> </head> <body&g ...
- Java算法-希尔排序
希尔排序的诞生是由于插入排序在处理大规模数组的时候会遇到需要移动太多元素的问题.希尔排序的思想是将一个大的数组“分而治之”,划分为若干个小的数组,以 gap 来划分,比如数组 [1, 2, 3, 4, ...
- Spring 配置文件applicationContext.xml
Spring配置文件是用于指导Spring工厂进行Bean生产.依赖关系注入(装配)及Bean实例分发的"图纸". Spring配置文件是一个或多个标准的XML文档,applica ...
- ios学习笔记
1.对于autorelease的理解 Each thread in a Cocoa application maintains its own stack of autorelease pool bl ...
- 【BZOJ-2588】Count on a tree 主席树 + 倍增
2588: Spoj 10628. Count on a tree Time Limit: 12 Sec Memory Limit: 128 MBSubmit: 3749 Solved: 873[ ...