문제 풀이/Codeforces
2020. 12. 13.
Codeforces Round #689 (Div. 2)
A - String Generation Problem - A - Codeforces codeforces.com \(n, k\)가 주어진다. a, b, c 3개의 문자로만 이루어져 있으면서, 최대 길이인 팰린드롬 부분문자열의 길이가 \(k\)이하인 길이 \(n\)의 문자열을 출력하면 된다. "abc"를 \(n\)길이만큼 출력하면 답이다. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 #include using namespace std; typedef long long ll; typedef pair pii; typedef pair pll; ll gcd(ll a, ll b) { for (; b; a %= b, swap(a, b)); return a;..