USACO 4

백준 26937 Circular Barn python 풀이

https://www.acmicpc.net/problem/26973 26973번: Circular BarnFor the first test case, Farmer John can remove $1$, $2$, or $3$ cows from the first room. Whichever number he removes, Nhoj can remove the remaining cow(s), forcing FJ to lose when they circle back to the first room. For the second test case, FJ can removwww.acmicpc.net  일단 N = 1인 경우를 생각해보자. 편의상 Farmer John을 FJ라 하고, Farmer Nhoj를 FN이라 부르..

알고리즘 2023.04.28

USACO 2020 December Contest silver 파이썬 풀이

어제 다른 분들이 쓴 USACO 후기를 조금 찾아봤는데, USACO 2020 December Contest 후기글을 찾았습니다. 일단 문제를 풀고 글을 읽고 싶었어서, 틈틈히 풀었습니다. 문제가 상당히 재밌었던 것 같습니다. 실제 풀이에 쓴 시간은1번 10분2번 30분3번 1시간정도 된 것 같습니다. https://www.acmicpc.net/problem/20647 20647번: CowntagionOne possible sequence of events corresponding to this example is the following: the number of sick cows in farm 1 doubles and then doubles again, so that after two days, the..

알고리즘 2023.03.13

USACO 2023 February Contest silver div 풀이

유사코가 끝난지 꽤 되었는데, 귀찮아서 풀이를 올리지 않다 이제야 올린다. 당시 대회에서 2, 3번을 1시간 30분정도에 걸쳐 풀고, 1번 문제를 계속 봤는데, 결국 섭테를 하나도 못긁었다. 이상한 관찰을 자꾸 하고 증명도 없이 살면서 풀어본적도 없는 기하적 해석을 했는데, 결국 그냥 뻘짓이었다. 다음부터는 문제가 어려워보이면 섭테 긁을 생각부터 해야겠다. https://www.acmicpc.net/problem/27847 27847번: Cow-libi Somebody has been grazing in Farmer John's $(1 \le G \le 10^5)$ private gardens! Using his expert forensic knowledge, FJ has been able to dete..

알고리즘 2023.03.13

백준 15587 Cow at Large (Gold) 파이썬 풀이

https://www.acmicpc.net/problem/15587 15587번: Cow at Large (Gold) Cornered at last, Bessie has gone to ground in a remote farm. The farm consists of $N$ barns ($2 \leq N \leq 10^5$) and $N-1$ bidirectional tunnels between barns, so that there is a unique path between every pair of barns. Every barn which has only one tun www.acmicpc.net 요즘 유사코 실~골 div를 돌고 있는데, 여기는 문제 난이도가 적당하고 굉장히 맛있는 것 같다. 다양한 ..

알고리즘 2023.03.11