Problem Solving

Problem Solving/BaekJoon

[BOJ/백준] 13023 - ABCDE

13023번: ABCDE 문제의 조건에 맞는 A, B, C, D, E가 존재하면 1을 없으면 0을 출력한다. www.acmicpc.net 제목 ABCDE 조건 시간 제한 : 2 초 메모리 제한 : 512 MB 문제 BOJ 알고리즘 캠프에는 총 N명이 참가하고 있다. 사람들은 0번부터 N-1번으로 번호가 매겨져 있고, 일부 사람들은 친구이다. 오늘은 다음과 같은 친구 관계를 가진 사람 A, B, C, D, E가 존재하는지 구해보려고 한다. A는 B와 친구다. B는 C와 친구다. C는 D와 친구다. D는 E와 친구다. 위와 같은 친구 관계가 존재하는지 안하는지 구하는 프로그램을 작성하시오. 입력 첫째 줄에 사람의 수 N (5 ≤ N ≤ 2000)과 친구 관계의 수 M (1 ≤ M ≤ 2000)이 주어진다. ..

Problem Solving/BaekJoon

[BOJ/백준] 11758 - CCW

11758번: CCW 첫째 줄에 P1의 (x1, y1), 둘째 줄에 P2의 (x2, y2), 셋째 줄에 P3의 (x3, y3)가 주어진다. (-10,000 ≤ x1, y1, x2, y2, x3, y3 ≤ 10,000) 모든 좌표는 정수이다. P1, P2, P3의 좌표는 서로 다르다. www.acmicpc.net CCW 제목 CCW 조건 시간 제한 : 1 초 메모리 제한 : 128 MB 문제 2차원 좌표 평면 위에 있는 점 3개 P1, P2, P3가 주어진다. P1, P2, P3를 순서대로 이은 선분이 어떤 방향을 이루고 있는지 구하는 프로그램을 작성하시오. 입력 첫째 줄에 P1의 (x1, y1), 둘째 줄에 P2의 (x2, y2), 셋째 줄에 P3의 (x3, y3)가 주어진다. (-10,000 ≤ x1,..

Problem Solving/BaekJoon

[BOJ/백준] 1011 - Fly me to the Alpha Centauri

1011번: Fly me to the Alpha Centauri 우현이는 어린 시절, 지구 외의 다른 행성에서도 인류들이 살아갈 수 있는 미래가 오리라 믿었다. 그리고 그가 지구라는 세상에 발을 내려 놓은 지 23년이 지난 지금, 세계 최연소 ASNA 우주 비행 www.acmicpc.net 제목 Fly me to the Alpha Centauri 조건 시간 제한 : 2 초 메모리 제한 : 512 MB 문제 우현이는 어린 시절, 지구 외의 다른 행성에서도 인류들이 살아갈 수 있는 미래가 오리라 믿었다. 그리고 그가 지구라는 세상에 발을 내려 놓은 지 23년이 지난 지금, 세계 최연소 ASNA 우주 비행사가 되어 새로운 세계에 발을 내려 놓는 영광의 순간을 기다리고 있다. 그가 탑승하게 될 우주선은 Alph..

Problem Solving/BaekJoon

[BOJ/백준] 2293 - 동전 1

2293번: 동전 1 첫째 줄에 n, k가 주어진다. (1 ≤ n ≤ 100, 1 ≤ k ≤ 10,000) 다음 n개의 줄에는 각각의 동전의 가치가 주어진다. 동전의 가치는 100,000보다 작거나 같은 자연수이다. www.acmicpc.net 배낭 제목 동전 1 조건 시간 제한 : 0.5 초 (추가 시간 없음) 메모리 제한 : 4 MB 문제 n가지 종류의 동전이 있다. 각각의 동전이 나타내는 가치는 다르다. 이 동전을 적당히 사용해서, 그 가치의 합이 k원이 되도록 하고 싶다. 그 경우의 수를 구하시오. 각각의 동전은 몇 개라도 사용할 수 있다. 사용한 동전의 구성이 같은데, 순서만 다른 것은 같은 경우이다. 입력 첫째 줄에 n, k가 주어진다. (1 ≤ n ≤ 100, 1 ≤ k ≤ 10,000) 다..

Problem Solving/CodeForces

[Codeforces/코드포스] Codeforces Round #811 (Div. 3) E - Add Modulo 10

Problem - 1714E - Codeforces codeforces.com 제목 Add Modulo 10 조건 time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output 문제 You are given an array of n integers a1,a2,…,an You can apply the following operation an arbitrary number of times: select an index i (1≤i≤n) and replace the value of the element ai with the value ai+(aimod10), where aimod10 ..

Problem Solving/CodeForces

[Codeforces/코드포스] Codeforces Round #811 (Div. 3) C - Minimum Varied Number

Problem - 1714C - Codeforces codeforces.com 제목 Minimum Varied Number 조건 time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output 문제 Find the minimum number with the given sum of digits s such that all digits in it are distinct (i.e. all digits are unique). For example, if s=20, then the answer is 389. This is the minimum number in which all digits ..

Problem Solving/CodeForces

[Codeforces/코드포스] Codeforces Round #811 (Div. 3) B - Remove Prefix

Problem - 1714B - Codeforces codeforces.com 제목 Remove Prefix 조건 time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output 문제 Polycarp was presented with some sequence of integers a of length n (1≤ai≤n). A sequence can make Polycarp happy only if it consists of different numbers (i.e. distinct numbers). In order to make his sequence like this, Polyc..

Problem Solving/CodeForces

[Codeforces/코드포스] Codeforces Round #811 (Div. 3) A - Everyone Loves to Sleep

Problem - 1714A - Codeforces codeforces.com 제목 Everyone Loves to Sleep 조건 time limit per test : 1 second memory limit per test : 256 megabytes input : standard input output : standard output 문제 Vlad, like everyone else, loves to sleep very much. Every day Vlad has to do nn things, each at a certain time. For each of these things, he has an alarm clock set, the i-th of them is triggered on hi hou..

Problem Solving/CodeForces

[Codeforces/코드포스] Codeforces Round #582 (Div. 3) C - Book Reading

Problem - 1213C - Codeforces codeforces.com 1 ≤ N , M ≤ 10^16이므로 int → long long M의 일의 자리로 arr 결정 M = 1, arr = 1 2 3 4 5 6 7 8 9 0 M = 2, arr = 2 4 6 8 0 2 4 6 8 0 M = 3, arr = 3 6 9 2 5 8 1 4 7 0 M = 4, arr = 4 8 2 6 0 4 8 2 6 0 M = 5, arr = 5 0 5 0 5 0 5 0 5 0 M = 6, arr = 6 2 8 4 0 6 2 8 4 0 M = 7, arr = 7 4 1 8 5 2 9 6 3 0 M = 8, arr = 8 6 4 2 0 8 6 4 2 0 M = 9, arr = 9 8 7 6 5 4 3 2 1 0 N /..

Problem Solving/CodeForces

[Codeforces/코드포스] Codeforces Round #582 (Div. 3) B - Bad Prices

Problem - 1213B - Codeforces codeforces.com 시간초과 문제 뒤에서 부터 제일 작은 min값을 설정하여 앞으로 검색하면서 비교 제목 Bad Prices 조건 time limit per test : 1 second memory limit per test : 256 megabytes input : standard input output : standard output 문제 Polycarp analyzes the prices of the new berPhone. At his disposal are the prices for N last days: a1,a2,…,an, where ai is the price of berPhone on the day i. Polycarp consi..

Problem Solving/CodeForces

[Codeforces/코드포스] Codeforces Round #582 (Div. 3) A - Chips Moving

Problem - 1213A - Codeforces codeforces.com 홀수와 짝수 제목 Chips Moving 조건 time limit per test : 1 second memory limit per test : 256 megabytes input : standard input output : standard output 문제 You are given N chips on a number line. The i-th chip is placed at the integer coordinate Xi. Some chips can have equal coordinates. You can perform each of the two following types of moves any (possibly, zer..

Problem Solving/CodeForces

[Codeforces/코드포스] Codeforces Round #579 (Div. 3) B - Equal Rectangles

Problem - 1203B - Codeforces codeforces.com 두 변이 쌍으로 존재하는 지 확인 모든 사각형이 하나의 크기로 정의되는 지 확인 제목 Equal Rectangles 조건 time limit per test : 2 second memory limit per test : 256 megabytes input : standard input output : standard output 문제 You are given 4N sticks, the length of the i-th stick is aiai. You have to create N rectangles, each rectangle will consist of exactly 4 sticks from the given set. Th..

JunHoChoi
'Problem Solving' 카테고리의 글 목록 (17 Page)