8000 boj 1181 · ChoJH1998/basic-algo-lecture@56e1c50 · GitHub
[go: up one dir, main page]

Skip to content

Commit 56e1c50

Browse files
committed
boj 1181
1 parent 41e1889 commit 56e1c50

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

0x0F/solutions/1181.cpp

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,23 @@
1-
// Authored by : BaaaaaaaaaaarkingDog
1+
// Authored by : tongnamuu
22
// Co-authored by : -
3-
// http://boj.kr/****************
3+
// http://boj.kr/e365634189b1497a95abaf856df7758f
44
#include <bits/stdc++.h>
55
using namespace std;
66

77
int main(void){
88
ios::sync_with_stdio(0);
99
cin.tie(0);
10-
11-
}
10+
int n;
11+
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

Comments
 (0)
0