coin1
1
2
3
4
5
| Mommy, I wanna play a game!
(if your network response time is too slow,
try nc 0 9007 inside pwnable.kr server)
Running at : nc pwnable.kr 9007
|
---------------------------------------------------
- Shall we play a game? -
---------------------------------------------------
You have given some gold coins in your hand
however, there is one counterfeit coin among them
counterfeit coin looks exactly same as real coin
however, its weight is different from real one
real coin weighs 10, counterfeit coin weighes 9
help me to find the counterfeit coin with a scale
if you find 100 counterfeit coins, you will get reward :)
FYI, you have 60 seconds.
- How to play -
1. you get a number of coins (N) and number of chances (C)
2. then you specify a set of index numbers of coins to be weighed
3. you get the weight information
4. 2~3 repeats C time, then you give the answer
- Example -
[Server] N=4 C=2 # find counterfeit among 4 coins with 2 trial
[Client] 0 1 # weigh first and second coin
[Server] 20 # scale result : 20
[Client] 3 # weigh fourth coin
[Server] 10 # scale result : 10
[Client] 2 # counterfeit coin is third!
[Server] Correct!
- Ready? starting in 3 sec... -
N=376 C=9
1
2
3
4
5
6
7
8
9
| 몇 개의 골드 코인이 있는데 그 중 하나의 위조코인이 있음.
코인의 무게는 10, 위조코인은 9.
참고로 60초 내로 100개의 위조 코인을 찾아달라고 함.
1. N개의 코인과 C개의 찬스를 얻음.
2. 무게를 확인할 인덱스 번호를 입력. 인덱스는 0번부터 시작.
3. 2번을 C번동안 반복
4. 답 입력
|
Solution