아직 만들고 있는 페이지입니다.

이 페이지는 아직 만드는 중입니다. 보이는 내용은 바뀔 수 있습니다.

Counterfeit Coin

시간 제한12.5초메모리 제한1024 MB

요약
무게가 다른 동전 하나가 섞인 n개의 동전에서 저울을 최소한으로 사용해 다른 동전을 찾는다.
난이도

보통10점 중 4점

유형
이분 탐색, 수학
정답자
아직 제출이 없습니다

문제

You are a market salesman. Every week you sell your wares in a beautiful authentic market stall. People travel from faraway lands to buy your signature product: fermented shark. Of course, such a delicious product should only be exchanged for a vast amount of shining, valuable coins.

Sometimes customers try to fool you by paying with counterfeit coins. You always spot them, of course; you take out your trusty scale and weigh the coins to determine if any of them are of different weight.

In this particular instance, a rather notorious customer by the name of Peter Rog Rammer, famous for his "off-by-one errors", has just paid for a fermented shark dish using nn seemingly identical coins. However, you are sure that there is one coin that is not quite the same as the others. As the line of customers is getting rather lengthy, you do not want to spend too much time finding the odd one out!

예제1

  1. 예제 1

    입력
    5
    
    equal
    
    lighter
    
    heavier
    
    
    예상 출력
    
    ? 1 5
    
    ? 4 3
    
    ? 2 4
    
    ! 4