Reverse a Substring
https://codeforces.com/contest/1155/problem/A
题解:找到两个字符逆序就行
/*
*@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=300000+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;
int a[N];
char str[N];
struct node{};
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);cin>>str;for(int i=1;i<n;i++){if(str[i-1]>str[i]){cout<<"YES"<<endl;printf("%d %d\n",i,i+1);return 0;}}cout<<"NO"<<endl;//}#ifdef DEBUGprintf("Time cost : %lf s\n",(double)clock()/CLOCKS_PER_SEC);
#endif//cout << "Hello world!" << endl;return 0;
}
Reverse a Substring相关推荐
- LeetCode之Reverse String II
1.题目 Given a string and an integer k, you need to reverse the first k characters for every 2k charac ...
- 正则表达式语法规则收集
turnmissile 的 Blog http://blog.csdn.net/turnmissile/ Microsoft已经把正则表达式的规则收录在了msdn里面了,有兴趣的朋友可以自己去研究一下 ...
- clickhouse 新增列_ClickHouse入门记录
安装 我写了个脚本放在 gist 可以执行以下命令来自动安装: curl -L https://gist.githubusercontent.com/emacsist/ebb98839c814cdb2 ...
- Java继承_Java面试题总结(一)
1.JDK和JRE有什么区别? JDK:Java 的开发工具包,提供了 Java 的开发环境和运行环境 JRE:Java 的运行环境,为 Java 的运行提供了所需环境 具体来说:JDK 其实包含了 ...
- 函数式编程语言python-函数式编程初探
诞生50多年之后,函数式编程(functional programming)开始获得越来越多的关注. 不仅最古老的函数式语言Lisp重获青春,而且新的函数式语言层出不穷,比如Erlang.clojur ...
- 【JAVA秒会技术之秒杀面试官】JavaSE常见面试题(二)
21.在Java中,如何跳出当前的多重嵌套循环? 答:在最外层循环前加一个标记如A,然后用break A;可以跳出多重循环.(Java中支持带标签的break和continue语句,作用有点类似于C和 ...
- leetcode 214. Shortest Palindrome | 214. 最短回文串(Java)
题目 https://leetcode.com/problems/shortest-palindrome/ 题解 看了 Related Topics - Rolling Hash 下的相关题目,看到了 ...
- String Modification CodeForces - 1316B(规律)
Vasya has a string s of length n. He decides to make the following modification to the string: Pick ...
- Codeforce-CodeCraft-20 (Div. 2)-B. String Modification (找规律+模拟)
Vasya has a string s of length n. He decides to make the following modification to the string: Pick ...
最新文章
- q函数表格怎么看_会计表格函数玩不会?超实用会计表格函数公式大全,财务人都在用...
- 48.结构体位域获取内存模型
- 对Python认识和对我专业的影响
- Nginx502,504和499错误解决方案
- 松下壁挂式新风系统推荐_壁挂式新风系统哪个好?
- 进程状态转换(了解)
- 工作总结19:文档参考
- Python os模块文件操作(二)
- C++数据结构02--链式线性表(单链表的实现)
- 计算机考场桌子大小,自己打卧室电脑书桌最小宽度尺寸多少合适
- 亲测window+iis+letsencrypt+ssl 手动续期(通配符域名)
- php中百度编辑器的使用
- 突发!ITELLYOU要改版了!
- MATLAB中 / 和 \ 的区别
- python 制作数据图表_python制作各种数据图表
- 读懂这三个关键词,就明白迅雷链为什么受开发者欢迎
- 图解迪士尼发展史:华特·迪士尼建立的动画王国
- 《刷新》读书笔记2-看萨提亚治下的微软文化变革
- CountDownTimer 一步实现最简单的倒计时控件
- php empty 注意
热门文章
- eureka自我保护时间_阿里面试官问我:到底知不知道什么是Eureka,这次,我没沉默...
- 前段react技术架构图_基于 React 的可视化编辑平台实践
- Java中给循环体起别名
- Mysql -uroot -p 登陆不上_MySQL命令行登陆,远程登陆MySQL 的方法
- 三十三、Java集合中的LinkedList
- 通过flask构建自己的代理池
- 今晚直播 | 微软亚洲研究院徐毅恒:预训练时代下的文档智能
- 3天造了一个深度学习轮子,生猛!
- ​NeurIPS 2020 | 面向张量分解知识图谱补全的对偶诱导正则
- 机器翻译中丢掉词向量层会怎样?