题目链接: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');
}
}

最新文章

  1. 解决ngnix服务器上的Discuz!x2.5 Upload Error:413错误
  2. Intellij Idea/Webstorm/Phpstorm 的高效快捷键
  3. javascript各种宽高
  4. javaScript 将json字符串转换为json对象的方法解析
  5. python——操作Redis
  6. css权值计算
  7. Scalaz(38)- Free :Coproduct-Monadic语句组合
  8. squid代理服务器根据代理IP路由
  9. web2py学习之getting start环境搭建
  10. 屏幕字段结构SCREEN的字段含义
  11. 减肥App计划
  12. git的安装已经连github
  13. quartz搭建与应用
  14. 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;
  15. Jmeter MD5插件
  16. 新概念英语(1-29)Come in, Amy.
  17. vue_小项目_吃饭睡觉打豆豆
  18. Web应用程序架构的比较
  19. gradle安装操作
  20. Java 并发编程(二)对象的不变性和安全的公布对象

热门文章

  1. HTTP基础认证Basic Authentication
  2. 第4章 使用 Spring Boot
  3. 配置laravel的nginx站点
  4. Intent 传递对象
  5. flask的restful api模块flask_restful和认证模块flask_httpauth
  6. JavaScript-4.7-friendly_table---ShinePans
  7. 从零開始开发Android版2048 (二)获取手势信息
  8. CSDN站点系统升级公告
  9. C++11 并发指南一(C++11 多线程初探)(转)
  10. Ubuntu下安装libsvm