博客
关于我
poj 3617 Best Cow Line 贪心
阅读量:432 次
发布时间:2019-03-06

本文共 474 字,大约阅读时间需要 1 分钟。

poj 3617 Best Cow Line

题目链接:

思路:

贪心

第一个字母和最后一个字母比较字典序,果如大小相同,左边指针++,右边指针--,继续比较
最后注意输出格式:每80个字母换一次行

代码:

#include 
#include
using namespace std;const int maxn = 2005;char s[maxn];char t[maxn];int main() { int n; scanf("%d",&n); getchar(); for(int i=0;i
s[r-i]) { flag=false; break; } } if(flag) t[index]=s[l],l++,index++; else t[index]=s[r],r--,index++; } for(int i=0;i

转载地址:http://emjyz.baihongyu.com/

你可能感兴趣的文章
mysql5.7的安装和Navicat的安装
查看>>
mysql5.7示例数据库_Linux MySQL5.7多实例数据库配置
查看>>
MySQL8.0.29启动报错Different lower_case_table_names settings for server (‘0‘) and data dictionary (‘1‘)
查看>>
MySQL8修改密码报错ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
查看>>
MySQL8找不到my.ini配置文件以及报sql_mode=only_full_group_by解决方案
查看>>
mysql8的安装与卸载
查看>>
mysqlbinlog报错unknown variable ‘default-character-set=utf8mb4‘
查看>>
mysqldump 导出中文乱码
查看>>
mysqldump备份时忽略某些表
查看>>
mysqldump实现数据备份及灾难恢复
查看>>
mysqlreport分析工具详解
查看>>
MySQL一个表A中多个字段关联了表B的ID,如何关联查询?
查看>>
MYSQL一直显示正在启动
查看>>
MySQL一站到底!华为首发MySQL进阶宝典,基础+优化+源码+架构+实战五飞
查看>>
MySQL万字总结!超详细!
查看>>
Mysql下载以及安装(新手入门,超详细)
查看>>
MySQL中B+Tree索引原理
查看>>
mysql中cast() 和convert()的用法讲解
查看>>
mysql中datetime与timestamp类型有什么区别
查看>>
mysql中floor函数的作用是什么?
查看>>