其他分享
首页 > 其他分享> > Educational Codeforces Round 121 (Rated for Div. 2) ABC(区间求并)

Educational Codeforces Round 121 (Rated for Div. 2) ABC(区间求并)

作者:互联网

A. Equidistant Letters

直接对原字符串进行排序,这样能保证相同的字母相邻,间隔为0.

#include <iostream>
#include <vector>
#include <algorithm>
#define pii pair<int,int>
#define fi first
#define se second
#define ll long long
using namespace std;
int main() {
	int t;
	cin >> t;
	while(t--) {
		string s;
		cin >> s;
		vector<char> v;
		for(auto x : s) v.push_back(x);
		sort(v.begin(), v.end());
		for(auto x : v) cout << x;
		cout << endl;
	}
	return 0;
}

B. Minor Reduction

You are given a decimal representation of an integer

标签:Educational,Rated,int,ll,Codeforces,stk,second,蓄力,define
来源: https://www.cnblogs.com/lipoicyclic/p/15862155.html