반응형

USACO 5

[BOJ] 백준 14452. Cow Dance Show (Gold III)

백준 잔디 채우려고 G4..G2 티어 중 랜덤하게 뽑아본 문제. 문제는 아래와 같다. https://www.acmicpc.net/problem/14452 14452번: Cow Dance Show After several months of rehearsal, the cows are just about ready to put on their annual dance performance; this year they are performing the famous bovine ballet "Cowpelia". The only aspect of the show that remains to be determined is the size of the stage www.acmicpc.net 여기서 제일 중요한 점! 소 ..

PS/BOJ 2022.02.16

[BOJ] 백준 17038. The Great Revegetation (Silver) (Gold II)

학교랭킹 랭작을 위해 풀은 문제인데, 꽤나 아이디어 면에서 얻어갈 게 많았다. 문제는 아래와 같다. https://www.acmicpc.net/problem/17038 17038번: The Great Revegetation (Silver) A lengthy drought has left Farmer John's $N$ pastures devoid of grass. However, with the rainy season arriving soon, the time has come to "revegetate". In Farmer John's shed, he has two buckets, each with a different type of grass seed. He wants to plant g www.acm..

PS/BOJ 2021.11.20

[BOJ] 백준 14168. Cow Checklist (Gold I)

우연의 일치로 두번 연속 Farmer John님을 영접하게 됐다. 개인적으로 Farmer John이 나오는 문제를 좋아하는데, 이유는 걍 재밌어서다. 문제는 아래와 같다. https://www.acmicpc.net/problem/14168 14168번: Cow Checklist Every day, Farmer John walks through his pasture to check on the well-being of each of his cows. On his farm he has two breeds of cows, Holsteins and Guernseys. His H Holsteins are conveniently numbered 1…H, and his G Guernseys are convenient..

PS/BOJ 2021.10.14

[BOJ] 백준 17028. Sleepy Cow Sorting (Silver IV)

슬슬 영어공부 및 토익을 준비할 때가 되기도 했고, 학교 교수님께서 알고리즘을 영어로 가르치시기 때문에 가끔씩 영어 문제를 풀면서 영어에 친숙해지는 시간을 가져보려고 한다. 그래서 푼 문제가 바로 이거다. https://www.acmicpc.net/problem/17028 17028번: Sleepy Cow Sorting Farmer John is attempting to sort his $N$ cows ($1 \leq N \leq 100$), conveniently numbered $1 \dots N$, before they head out to the pastures for breakfast. Currently, the cows are standing in a line in the order $p_1,..

PS/BOJ 2021.10.14

[BOJ] 백준 14461. 소가 길을 건너간 이유 7 (Gold II)

최근에 ucpc, koi, usaco 등 대회 문제 질이 좋음을 깨달았다. 그래서 대회 문제를 풀어보던 중 맨날 '농부 john', 'farmer john', '소가 길을 건너는 이유' 등의 주제로 농부 문제를 내는 문제가 있음을 알게 되고 풀어본 문제이다. 이 문제는 처음엔 굉장히 쉬운 dp, dijkstra, bfs문제인 줄 알았으나, dp, bfs로는 풀 수가 없다. 그 이유는 아래와 같다. bfs로 풀기에는 각각의 길에 가중치가 있다. dp로 풀기에는 각각의 풀숲을 몇 번째에 지났는지에 따라 중복돼서 이용될 수가 있다. 사실 맨처음에는 dp로 풀 수 있지 않을까 생각했다. bfs는 사실 처음엔 생각나지 않았다. (이건 bfs를 많이 풀어보면 느낄 것이다. 가중치가 있으면 dijkstra, 가중치가..

PS/BOJ 2021.04.23
1
반응형