Skip to content

Instantly share code, notes, and snippets.

@Semior001
Created November 27, 2018 07:54
Show Gist options
  • Save Semior001/06444d328fed447e249daa3f7c3a2331 to your computer and use it in GitHub Desktop.
Save Semior001/06444d328fed447e249daa3f7c3a2331 to your computer and use it in GitHub Desktop.
#include <bits/stdc++.h>
#define sqr(a) (a) * (a)
using namespace std;
int n;
string s[1000000];
int a[1000000];
int main(){
cin >> n;
for(int i = 0; i < n; i++){
cin >> s[i] >> a[i];
}
sort(s, s + n);
sort(a, a + n);
for(int i = 0; i < n; i++){
cout << s[i] << ' ' << a[i] << endl;
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment