https://i2.wp.com/eblogarithm.com/wp-content/uploads/2017/07/Codeforces-Round-409-rated-Div-2-based-on-VK-Cup-2017-Round-2-problem-B-Valued-Keys-Solution-In-CC1.png?fit=640%2C360

Codeforces Round #409 (rated, Div. 2, based on VK Cup 2017 Round 2), problem: (B) Valued Keys Solution In C/C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
	string a,b;
	cin>>a>>b;
	int l=a.length();
	for(int i=0;i<l;i++)
	{
	     if(a[i]<b[i])
	    {
	    cout<<"-1";
	    return 0;
	    }
	}
	cout<<b;
}
(Visited 6 times, 1 visits today)



There are no comments

Add yours

Leave a Reply

%d bloggers like this: