HDU4850 Wow! Such String! —— 字符串构造
2024-09-08 01:11:28
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4850
代码如下:
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <sstream>
#include <algorithm>
using namespace std;
#define pb push_back
#define mp make_pair
#define ms(a, b) memset((a), (b), sizeof(a))
#define eps 0.0000001
typedef long long LL;
const int INF = 2e9;
const LL LNF = 9e18;
const int mod = 1e9+;
const int maxn = ***;
int a[maxn+];
int vis[][][][]; void solve()
{
a[] = a[] = a[] = ;
for(int i = ; i<maxn+; i++)
{
for(int j = ; j>=; j--)
{
if(vis[a[i-]][a[i-]][a[i-]][j]==)
{
vis[a[i-]][a[i-]][a[i-]][j] = ;
a[i] = j;
break;
}
}
}
} int main()
{
int n;
solve();
while(scanf("%d",&n)!=EOF)
{
if(n>maxn+)
printf("Impossible");
else
for(int i = ; i<n; i++)
printf("%c",a[i]+'a');
putchar('\n');
}
}
最新文章
- 解决ngnix服务器上的Discuz!x2.5 Upload Error:413错误
- Intellij Idea/Webstorm/Phpstorm 的高效快捷键
- javascript各种宽高
- javaScript 将json字符串转换为json对象的方法解析
- python——操作Redis
- css权值计算
- Scalaz(38)- Free :Coproduct-Monadic语句组合
- squid代理服务器根据代理IP路由
- web2py学习之getting start环境搭建
- 屏幕字段结构SCREEN的字段含义
- 减肥App计划
- git的安装已经连github
- quartz搭建与应用
- org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.reflection.ReflectionException: There is no getter for property named &#39;__frch_lableId_0&#39; in &#39;class com.cd.entity.Page&#39;
- Jmeter MD5插件
- 新概念英语(1-29)Come in, Amy.
- vue_小项目_吃饭睡觉打豆豆
- Web应用程序架构的比较
- gradle安装操作
- Java 并发编程(二)对象的不变性和安全的公布对象
热门文章
- HTTP基础认证Basic Authentication
- 第4章 使用 Spring Boot
- 配置laravel的nginx站点
- Intent 传递对象
- flask的restful api模块flask_restful和认证模块flask_httpauth
- JavaScript-4.7-friendly_table---ShinePans
- 从零開始开发Android版2048 (二)获取手势信息
- CSDN站点系统升级公告
- C++11 并发指南一(C++11 多线程初探)(转)
- Ubuntu下安装libsvm