★★☆☆☆
기본 정렬을 사용해서 문자열을 사전식으로 배열하는 문제
string tem으로 임시 문자열을 만들고,
그 문자열에 append를 통해 i번째부터 len-i개만큼의 문자열을 복사한다.
tem을 vector에 넣고, sort 정렬을 통해 오름차순 정렬해주면 된다.
#include <iostream>
using namespace std;
long long gcd(long long x, long long y) {
long long r=0;
while (y != 0) {
r = x % y;
x = y;
y = r;
}
return x;
}
int main() {
long long a, b;
cin >> a;
cin >> b;
//cout << gcd(a, b) << "\n";
long long ret = gcd(a, b);
for (int i = 0; i < ret; i++) {
cout << 1;
}
cout << "\n";
return 0;
}
https://github.com/jeongopo/DaliyCodeCpp/commit/33258f3fec3a9f3dabe5727e7101cf4e97883bff