Two Anagrams 记录这个棒的操作

Posted 要坚持写博客

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Two Anagrams 记录这个棒的操作相关的知识,希望对你有一定的参考价值。

参考了题解的程序。
之前都不知道string还能用sort去排序,太优秀了!!!

学费了!!!

#include<cstdio>
#include<cstring>
#include<algorithm>
#include<map>
#include<iostream>
#include<cmath>
#include<queue>
#include<vector>
#define IOS ios::sync_with_stdio(false);cin.tie();cout.tie(0)

using namespace std;
typedef pair<int,int> pll;
typedef long long ll;
const int N=2e5+100;
const int maxn=550;
const int M=100003;

map<string,int> q;
int cnt[N];
ll sum;

int main()

    IOS;
    string s;
	cin >> s;
	sort(s.begin(), s.end());
	
	string t;
	cin >> t;
	sort(t.begin(), t.end());
	reverse(t.begin(), t.end());
	
	if (s < t) cout << "Yes" << endl;
	else cout << "No" << endl;
    return 0;


好题1

以上是关于Two Anagrams 记录这个棒的操作的主要内容,如果未能解决你的问题,请参考以下文章

Two Strings Are Anagrams

LintCode Two Strings Are Anagrams

Two Strings Are Anagrams

49. Group Anagrams

49. Group Anagrams

乱序字符串anagrams