Masala #DDIBQZKFWN
RUN & CAN
Minecraftga endi kelgan NOOB moblar(hayvonlar) yaxshi yoki yomonligini bilmaydi. Agar u oldidagi mob yomon bo'lsa, u qochadi. Yaxshi bo'lsa o'zini ishini qiladi. U moblarni qandayligini bilish uchun maktabga bordi. Qancha urunmasin baribir bilmayapti. Unga yordam bering. Lekin u maxluqlar olganda tashlaydigan DROPlar orqali ularni topa oladi.
Kirish faylida 1-qatorda N son beriladi. qolgan qatorlarda N ta S satr - MOBlar tashlagan DROPlar kiritiladi.
Chiqish faylida agar DROP maxluqga tegishli bo'lsa “RUN”, aks holda “CAN”ni chop eting
# | input.txt | output.txt |
---|---|---|
1 |
4 ender pearl raw beef rotten flesh coal |
RUN CAN RUN RUN |
2 |
1 ghast tear |
RUN |
Bilib qoying faqatgina “rotten flesh, gunpowder, ghast tear, magma cream, string, blaze rod, nether star, coal,stone sword, slimeball, gold nugget, golden sword, golden axe, copper ingot, ender pearl, phantom membrane, bone, arrow, poisoned arrow, saddle” maxluqlarga tegishli.
Misol uchun 1-testda 4 ta DROP kiritilgan. "ender pearl" maxluqga tegishli - RUN. “raw beef” maxluqga tegishli emas - CAN. “rotten flesh” maxluqga tegishli - RUN va “coal” ham maxluqga tegishli - RUN. JAVOB ESA - “RUN CAN RUN RUN”(alohida qatorda)!