#include <stdio.h>
int K, cpos;
char cup[3];
void solve()
{
for (int i = 0; i < K; i++)
{
if (cpos != 2)
cpos = (cpos + 1) % 2;
else
cpos = (cpos % 2) + 1;
}
}
int main()
{
int tc = 0;
scanf("%d", &tc);
for (int t = 1; t <= tc; t++)
{
for (int i = 0; i < 3; i++)
{
scanf(" %c", &cup[i]);
}
scanf("%d", &K);
for (int i = 0; i < 3; i++)
{
if (cup[i] == 'o')
{
cpos = i;
break;
}
}
solve();
printf("#%d %d\n", t, cpos);
}
}
1. 방울 울린 횟수만큼 방울이 있는 컵을 섞는다
2. 현재 방울이 있을 확률이 가장 높은 컵이 여러개라면 가장 왼쪽에 있는 컵이라고 하니깐 가운데에 방울이 있다면 왼쪽으로 섞는다
3. 끝
'공부 > SWEA' 카테고리의 다른 글
SWEA 4371. 항구에 들어오는 배 (C++) (0) | 2024.05.11 |
---|---|
SWEA 20019. 회문의 회문 (C++) (0) | 2024.05.11 |
SWEA 4615. 재미있는 오셀로 게임 (C++) (0) | 2024.05.10 |
SWEA 3282. 0/1 Knapsack (C++) (0) | 2024.05.10 |
SWEA 19113. 식료품 가게 (C++) (0) | 2024.05.10 |