8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 41e1889 commit 56e1c50< 8000 /button>Copy full SHA for 56e1c50
0x0F/solutions/1181.cpp
@@ -1,11 +1,23 @@
1
-// Authored by : BaaaaaaaaaaarkingDog
+// Authored by : tongnamuu
2
// Co-authored by : -
3
-// http://boj.kr/****************
+// http://boj.kr/e365634189b1497a95abaf856df7758f
4
#include <bits/stdc++.h>
5
using namespace std;
6
7
int main(void){
8
ios::sync_with_stdio(0);
9
cin.tie(0);
10
-
11
-}
+ int n;
+ cin>>n;
12
+ vector<string>a(n);
13
+ for(int i=0;i<n;++i) cin>>a[i];
14
+ sort(a.begin(), a.end(), [](const string& u, const string& v){
15
+ int ul = u.length();
16
+ int vl = v.length();
17
+ if(ul!=vl) return ul < vl;
18
+ return u < v;
19
+ });
20
+ a.erase(unique(a.begin(), a.end()), a.end());
21
+ for(string& s : a) cout<<s<<'\n';
22
+ return 0;
23
+}
0 commit comments