PS
백준 14453. Hoof, Paper, Scissors (Silver)
tose33
2022. 9. 9. 15:18
https://www.acmicpc.net/problem/14453
14453번: Hoof, Paper, Scissors (Silver)
You have probably heard of the game "Rock, Paper, Scissors". The cows like to play a similar game they call "Hoof, Paper, Scissors". The rules of "Hoof, Paper, Scissors" are simple. Two cows play against each-other. They both count to three and then each s
www.acmicpc.net
pair<int,int> d[i][j] = { j번째 게임에서 낸것을 바꾸지 않고 이길수 있는 최대 수, j번째 게임에서 낸 것을 바꾸고 이길수 있는 최대 수 }
낼수 있는 것은 H, P, S 가 있고, 딱 한번 낸 것을 바꿀수 있기 때문에 전체 게임에서 낼수 있는 조합은 총 여섯가지다.
HS, HP, SH, SP, PH, PS
예를들어 HS는 처음에 H를 내다가 중간에 S로 바꾸는 경우다.