#include <iostream>
#include <string>
#include <algorithm>
using namespace std;

int main(void)
{
	string a, b;
	cin >> a >> b;
	if (a.size() == 3 and b.size() == 3)
	{
		reverse(a.begin(), a.end());
		reverse(b.begin(), b.end());
		if (a > b)
			cout << a;
		else
			cout << b;
	}
	return 0;
}
import sys
input = sys.stdin.readline
N, M, K = list(map(int, input().split()))
team = 0

# my fault
# intern = 0
# while True:
#     if N//2 >= M:
#         N = N-1
#         intern = intern + 1
#         if K == intern:
#             break
    
#     elif N//2 < M:
#         M = M -1
#         intern = intern + 1
#         if K == intern:
#             break

# t1 = N // 2
# t2 = M 
# print(min(t1, t2))

while True:
    N = N - 2
    M = M - 1
    if N < 0 or M < 0 or (N+M) < K:
        break
    team = team + 1
print (team)
A, B = map(str, input().split())
if "6" in A or "6" in B:
    A = A.replace("6","5")
    B = B.replace("6","5")
_min = sum(map(int, [A, B]))

if "5" in A or "5" in B:
    A = A.replace("5","6")
    B = B.replace("5","6")
_max = sum(map(int, [A, B]))
print (_min, _max)
#include <iostream>

#define BIG 5
#define SMALL 3

using namespace std;

int Solution(int N)
{
	int quoteB = N / BIG; // 큰 설탕의 upper bound를 우선 결정
	
	while(true)
	{
		
		int Remainder = N - (BIG * quoteB); // 큰 설탕의 개수에 따라 나머지 결정 
		if (Remainder % SMALL == 0)	// 나머지가 작은 설탕으로 딱 떨어질 경우, 큰 설탕 개수 + 작은 설탕 개수 반환 
		{
			int quoteS = Remainder / SMALL;
			return quoteB+quoteS;
		}
		
		if (quoteB == 0)
			break;
			
		quoteB = quoteB -1;
	}
	
	return -1;
	
}

int main(void)
{
	int N = 0;
	
	cin >> N;
	
	if (N>=3 and N<=5000)
	{
		int result = Solution(N);
		cout << result;
	}
	
	return 0;
}
N, M = list(map(int, input().split()))
numbers = list(map(int, input().split()))
max = 0
for i in range(0, len(numbers)):
    for j in range(i+1, len(numbers)):
        for k in range(j+1, len(numbers)):
            temp = numbers[i] + numbers[j] + numbers[k]
            if temp > max and temp <=M:
                max = temp
print (max)
#include <iostream>
using namespace std;

bool checkLeapYear(int year)
{
	if ((year % 4 == 0 and year % 100 != 0) or (year % 4 ==0 and year % 400 == 0))
	{
		return true;
	}
	
	else
	{
		return false;
	}
}

int main(void)
{
	int result = -1; // 여부 확인 
	int year = 0; // 입력 연도 

	cin >> year;
	
	if (year>=1 and year<=4000)
	{
		result = checkLeapYear(year);
		cout << result << endl; 	
	}

	return 0;
}
#include <iostream>

using namespace std;

int main(void)
{
	int N = 0;
	
	cin >> N;
	
	if (N>=1 and N<=100000)	
	{
		for (int i=N; i>0; i--)
		{
			cout << i << '\n';
		}
	}
	
	return 0;
}
#include <iostream>

using namespace std;

int main(void)
{
	int N = 0;
	
	cin >> N;
	
	if (N>=1 and N<=100000)
	{
		for (int i=1; i<=N; i++)
		{
			cout << i << '\n';
		}
	}
}
#include <stdio.h>

int main(void)
{
	int N = 0;
	
	scanf("%d", &N);
	
	if (N >= 1 and N <= 9)
	{
		for (int i=1; i<=9; i++)
		{
			printf("%d * %d = %d\n", N, i, N*i);
		}
	}
	
	else
		return 0;
		
	return 0;
}
import sys
T = int(input())
for _ in range(T):
    count, string = sys.stdin.readline().split()
    P = ""
    for s in range(len(string)):
        P += string[s] * int(count)
        if s == len(string) -1:
            print (P)

'Computer Science > 백준 알고리즘' 카테고리의 다른 글

[백준] 2741번 N 찍기 (C++)  (0) 2022.03.16
[백준] 2739번 구구단 (C)  (0) 2022.03.16
[백준] 2588번 곱셈 (C++)  (0) 2022.03.16
[백준] 2581번 소수 (C++)  (0) 2022.03.16
[백준] 2577번 숫자의 개수 (C++)  (0) 2022.03.16

+ Recent posts