본문 바로가기

알고리즘/백준 문제 풀이

[Python] 스프라그-그런디 정리 활용 문제 모음

728x90

2022.11.01 - [백준 문제 풀이] - [Python] 13034번 다각형 게임 / 16187번 Game on Plane

 

[Python] 13034번 다각형 게임 / 16187번 Game on Plane

https://www.acmicpc.net/problem/13034 13034번: 다각형 게임 N개의 꼭짓점으로 이루어진 볼록 다각형이 있다. 다각형의 내각은 모두 180보다 작다. 꼭짓점은 1부터 N번까지 시계 방향으로 번호가 매겨져 있다

lighter.tistory.com

2022.11.01 - [백준 문제 풀이] - [Python] 16895번 님 게임 3 / 7685번 Nim

 

[Python] 16895번 님 게임 3 / 7685번 Nim

https://www.acmicpc.net/problem/16895 16895번: 님 게임 3 구사과와 큐브러버가 님 게임을 하고 있다. 님 게임은 돌을 위로 쌓아올린 돌 더미 k개를 이용한다. 각각의 돌 더미에는 한 개 이상의 돌이 있다. 두

lighter.tistory.com

2022.11.02 - [백준 문제 풀이] - [Python] 16899번 채석장 게임

 

[Python] 16899번 채석장 게임

https://www.acmicpc.net/problem/16899 16899번: 채석장 게임 첫째 줄에 채석장의 수 N(1 ≤ N ≤ 100,000)이 주어진다. 둘째 줄부터 N개의 줄에 채석장의 정보가 주어진다. 채석장의 정보는 두 정수 Xi, Mi (1 ≤ Xi,

lighter.tistory.com

2022.11.02 - [백준 문제 풀이] - [Python] 11869번 님블

 

[Python] 11869번 님블

https://www.acmicpc.net/problem/11869 11869번: 님블 님블은 1×N 직사각형에서 즐기는 게임이다. 직사각형은 1×1 크기의 정사각형으로 나누어져 있고, 가장 왼쪽 정사각형은 0번, 그 오른쪽 정사각형은 1번,

lighter.tistory.com

2022.11.15 - [백준 문제 풀이] - [Python] 7787번 빨간 칩, 초록 칩

 

[Python] 7787번 빨간 칩, 초록 칩

https://www.acmicpc.net/problem/7787 7787번: 빨간 칩, 초록 칩 이 게임은 빨간 칩 r개와 초록 칩 g개를 책상 위에 놓고 진행한다. 두 플레이어 A와 B는 턴을 번갈아가면서 게임을 하며, A가 먼저 시작한다. 게

lighter.tistory.com

2022.11.17 - [백준 문제 풀이] - [Python] 16340번 Split Game

 

[Python] 16340번 Split Game

https://www.acmicpc.net/problem/16340 16340번: Split Game For a long time, rich clientele of Binary Casino has been requesting a new way to gamble their money. To fulfill their wishes, the director of Binary Casino decided to introduce a new game called S

lighter.tistory.com

2022.11.22 - [백준 문제 풀이] - [Python] 16886번 나누기 게임

 

[Python] 16886번 나누기 게임

https://www.acmicpc.net/problem/16886 16886번: 나누기 게임 구사과와 큐브러버는 나누기 게임을 하려고 한다. 이 게임은 돌이 N개 포함되어 있는 돌 더미 1개에서 시작한다. 두 사람은 턴을 번갈아 가지며,

lighter.tistory.com

2023.05.04 - [백준 문제 풀이] - [Python] 27306번 DAGame

 

[Python] 27306번 DAGame

https://www.acmicpc.net/problem/27306 27306번: DAGame 첫 번째 줄에 노드의 개수를 나타내는 정수 $N$ ($2 \le N \leq 500$), 간선의 개수를 나타내는 정수 $M$ ($1 \leq M \leq 100\,000$)이 주어진다. 두 번째 줄 부터 $M$개

lighter.tistory.com

2023.05.17 - [백준 문제 풀이] - [Python] 19114번 Master Zhu and Candies (증명 추가 필요)

 

[Python] 19114번 Master Zhu and Candies (증명 추가 필요)

https://www.acmicpc.net/problem/19114 19114번: Master Zhu and Candies Master Zhu puts $n$ heaps of candies on the table. Two players are playing the following game: on their turn, each player can either pick any positive number of candies from the same he

lighter.tistory.com

2023.05.17 - [백준 문제 풀이] - [Python] 16887번 루트 님 게임

 

[Python] 16887번 루트 님 게임

https://www.acmicpc.net/problem/16887 16887번: 루트 님 게임 첫째 줄에 돌 더미의 개수 N(1 ≤ N ≤ 100,000)이 주어지고, 둘째 줄에 돌 더미에 포함된 돌의 개수 Ai(1 ≤ Ai ≤ 1,000,000,000,000)가 주어진다. www.acmicpc

lighter.tistory.com

2023.05.31 - [백준 문제 풀이] - [Python] 8845번 Gra

 

[Python] 8845번 Gra

https://www.acmicpc.net/problem/8845 8845번: Gra Dla każdej konfiguracji początkowej w osobnej linii wypisz "W", jeśli Hektor wygra grę przy danym ustawieniu, "P" w przeciwnym przypadku. www.acmicpc.net 23/05/31 스프라그-그런디 정리가 적용

lighter.tistory.com

2023.09.01 - [알고리즘/백준 문제 풀이] - [Python] 18689번 Baklawa

 

[Python] 18689번 Baklawa

https://www.acmicpc.net/problem/18689 18689번: Baklawa Baklawa or baklava, is a sweet middle eastern dessert, mainly made from phyllo dough sheets, walnuts, and sugar syrup cut into small cubic pieces and served in cuboid boxes containing multiple layers.

lighter.tistory.com