FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
competitive-programming/String/(CODEFORCES)946C.cpp at master · kothariji/competitive-programming · GitHub
kothariji
/
competitive-programming
Public
Notifications
You must be signed in to change notification settings
Fork
500
Star
704
Code
Issues
1
Pull requests
2
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
competitive-programming
/
String
/
(CODEFORCES)946C.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
26 lines (26 loc) · 537 Bytes
Breadcrumbs
competitive-programming
/
String
/
(CODEFORCES)946C.cpp
Copy path
File metadata and controls
26 lines (26 loc) · 537 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
//
solution for 946C - https://codeforces.com/contest/946/problem/C
#
include
<
bits/stdc++.h
>
using
namespace
std
;
int
main
() {
string str;
cin >> str;
char
ch =
'
a
'
;
bool
flag =
false
;
for
(
int
i=
0
; i < str.
size
() ; i++){
if
(str[i] <= ch){
str[i] = ch;
if
(ch ==
'
z
'
){
flag=
true
;
break
;
}
ch= ch +
1
;
}
}
if
(!flag){
cout << -
1
<< endl;
}
else
{
cout << str << endl;
}
return
0
;
}
Back
|
FazBrowse Home
|
New Git URL