#include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin >> n;
int a[n];
for(int i=0 ; i < n ;++i ){
cin >> a[i];
}
sort(a,a + n);
for(int i = 0;i< n;++i){
cout << a[i] << " ";
}
cout << endl;
// 请在此输入您的代码
return 0;
}
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main(void) {
ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
int n,sum = 0; cin >> n;
priority_queue <int> mm;
for (int i = 0; i < n; ++i)
{
int x; cin >> x;
mm.push(x);
sum += x;
}
ll mx = mm.top();
if (sum - mx >= mx-1)
{
cout << "Yes" << endl;
}
else {
cout << "No" <<endl;
}
return 0;
}
#include <bits/stdc++.h>
using namespace std;
const int N = 105;
char s[N];
stack <char> stc;
int main(){
int n;cin >> n;
cin >> s;
bool ans = true;
for(int i = 0; i < n ;++i){
if(s[i] == '('){
stc.push('(');
}
else{
if(stc.size() && stc.top() == '(' ){
stc.pop();
}
else
ans = false;
}
}
if(stc.size())
ans = false;
if(ans)
cout << "Yes" <<endl;
else
cout << "No" << endl;
return 0;
}
#include <bits/stdc++.h>
using namespace std;
map <string, vector<string> > mp;
vector<string> citynumbers;
int main()
{
ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
int n; cin >> n;
for (int i = 0; i < n; ++i) {
string x, y; cin >> x >> y;
if (!mp.count(y))
{
citynumbers.push_back(y);
}
mp[y].push_back(x);
}
for (const auto& citynumber : citynumbers)
{
cout << citynumber << ' ' << mp[citynumber].size() << '\n';
for (const auto& i : mp[citynumber])
{
cout << i << '\n';
}
}
// 请在此输入您的代码
return 0;
}