รับเป็นบอร์ดขนาดตัวแปรที่มีขนาดสูงสุด 5 ครั้ง 5 สาขา ทุกสาขาจะเต็มไปด้วย 'x' ถ้ามันไม่ได้เต็มไปด้วย 'x' มันก็จะเต็มไปด้วย 'o'
สถานะเริ่มต้นของทุกบอร์ดจะได้รับ (ดูด้านล่าง) แต่ละกระดานจะต้องเล่น 10 รอบ (อย่างมาก, ตามเงื่อนไข: ดูด้านล่าง) และต้องดูวิวัฒนาการของ x
หนึ่งรอบทำงานด้วยวิธีต่อไปนี้:
- 'x' ทุกตัวจะแพร่กระจายไปยังเขตข้อมูลที่มีขอบตั้งฉาก แต่จะหายไปเอง
- แต่ละครั้งที่ 'x' สองตัวอยู่ในเขตข้อมูลเดียว
วิวัฒนาการของ 'x' ในแต่ละรอบจะต้องเกิดขึ้นพร้อมกัน ตัวอย่าง:
o o o o x o
o x o -> x o x
o o o o x o
ด้วยวิวัฒนาการแต่ละรอบคุณต้องดูว่ากระดานว่างเปล่า 'x' หรือไม่ ไม่ว่างเปล่าอาจมีรูปแบบการทำซ้ำ หากไม่เป็นเช่นนั้นเราจะยกเลิกการวิเคราะห์วิวัฒนาการ นอกจากนี้คุณต้องพิมพ์เปอร์เซ็นต์สูงสุดของฟิลด์ x สำหรับบอร์ดเริ่มต้นทุกอัน (ปัดเศษลงเป็นจำนวนเต็ม)
การป้อนข้อมูล:
สามารถดูข้อมูลอินพุตได้ที่นี่ (Pastebin) ข้อมูลนี้มีสถานะเริ่มต้น 100 สถานะ ตามที่ได้กล่าวไปแล้วบอร์ดมีขนาดแตกต่างกัน จำนวนแถวถูกระบุด้วยหมายเลข n จาก 1 ถึง 5 ตามด้วย n แถวที่มีเฉพาะ 'x' และ 'o' แทนรูปแบบเริ่มต้น บอร์ดทุกแถวมี 1 ถึง 5 ฟิลด์
เอาท์พุท:
ผลลัพธ์ที่สมบูรณ์จะต้องพิมพ์ออกมาหนึ่งแถวที่พิมพ์ออกมาสำหรับแต่ละบอร์ดเริ่มต้นในรูปแบบต่อไปนี้:
Round {0-10}: {repetition/empty/giveup}, {0-100} percent maximum-fill
ตัวอย่าง:
ตัวอย่างที่ 1:
Input: 2 Starting state: x o x
xox x x
xx
Round 1: x x o
o x
Round 2: x o x
o x
Round 3: o x o
o o
Round 4: x o x -> The pattern repeats:
o x It is the same as in round 2,
therefore we stop. Maximum fill was
in the starting state with four times 'x'
of 5 fields altogether,
so we have 4/5 = 80 %.
Output: Round 4: repetition, 80 percent maximum-fill
ตัวอย่างที่ 2:
Input: 1 Starting state: x x
xx
Round 1: x x -> We already have a repetition, because
the pattern is the same as in the starting
state. The board is always filled 100 %.
Output: Round 1: repetition, 100 percent maximum-fill
หลังจากแปดวันฉันจะทำเครื่องหมายคำตอบการทำงานด้วยตัวละครน้อยที่สุดในฐานะผู้ชนะ นอกจากนี้ฉันจะโพสต์เอาต์พุตที่ถูกต้องสำหรับ 100 บอร์ดเริ่มต้น (อินพุต)
คุณสามารถใช้ภาษาที่ต้องการ (การเขียนโปรแกรม / สคริปต์ / อะไรก็ได้)
มีความสุข!
PS: ถ้าคุณมีคำถามอย่าลังเลที่จะถาม
PPS: ในส่วนของผู้สร้างเดิม: สำหรับคนที่ความสามารถในการพูดภาษาเยอรมันคำถามที่ถูกนำมาจากไม่คลิกถ้าคุณไม่ต้องการ SPOILERS ที่นี่ ตั้งแต่เวลาอย่างเป็นทางการในการทำสิ่งที่ท้าทายได้สิ้นสุดลงฉันต้องการดูว่ามีใครบางคนสามารถคิดหาคำตอบสั้น ๆ และสง่างามได้หรือไม่
2014/04/22:
ท้าทายเสร็จแล้ว! ผู้ชนะที่ทำเครื่องหมายว่ายอมรับแล้ว เอาท์พุทที่ถูกต้อง:
Round 10: giveup, 50 percent maximum-fill
Round 5: empty, 66 percent maximum-fill
Round 1: repetition, 100 percent maximum-fill
Round 1: empty, 100 percent maximum-fill
Round 4: repetition, 100 percent maximum-fill
Round 4: repetition, 70 percent maximum-fill
Round 2: repetition, 60 percent maximum-fill
Round 4: empty, 88 percent maximum-fill
Round 10: giveup, 50 percent maximum-fill
Round 5: repetition, 80 percent maximum-fill
Round 10: repetition, 80 percent maximum-fill
Round 1: empty, 80 percent maximum-fill
Round 3: repetition, 60 percent maximum-fill
Round 4: repetition, 48 percent maximum-fill
Round 9: empty, 41 percent maximum-fill
Round 10: giveup, 92 percent maximum-fill
Round 10: giveup, 53 percent maximum-fill
Round 10: giveup, 66 percent maximum-fill
Round 6: repetition, 50 percent maximum-fill
Round 10: giveup, 88 percent maximum-fill
Round 10: giveup, 76 percent maximum-fill
Round 10: giveup, 68 percent maximum-fill
Round 10: giveup, 40 percent maximum-fill
Round 10: giveup, 100 percent maximum-fill
Round 10: giveup, 71 percent maximum-fill
Round 2: empty, 81 percent maximum-fill
Round 6: repetition, 36 percent maximum-fill
Round 10: giveup, 61 percent maximum-fill
Round 10: giveup, 60 percent maximum-fill
Round 4: repetition, 66 percent maximum-fill
Round 10: giveup, 72 percent maximum-fill
Round 3: empty, 80 percent maximum-fill
Round 10: giveup, 50 percent maximum-fill
Round 10: giveup, 83 percent maximum-fill
Round 7: repetition, 37 percent maximum-fill
Round 9: repetition, 85 percent maximum-fill
Round 5: repetition, 40 percent maximum-fill
Round 5: repetition, 60 percent maximum-fill
Round 4: empty, 80 percent maximum-fill
Round 10: giveup, 60 percent maximum-fill
Round 4: repetition, 46 percent maximum-fill
Round 6: repetition, 42 percent maximum-fill
Round 10: giveup, 72 percent maximum-fill
Round 4: repetition, 70 percent maximum-fill
Round 4: repetition, 80 percent maximum-fill
Round 6: repetition, 50 percent maximum-fill
Round 4: repetition, 56 percent maximum-fill
Round 10: giveup, 60 percent maximum-fill
Round 10: giveup, 54 percent maximum-fill
Round 10: giveup, 66 percent maximum-fill
Round 2: repetition, 40 percent maximum-fill
Round 2: repetition, 40 percent maximum-fill
Round 6: repetition, 75 percent maximum-fill
Round 7: empty, 85 percent maximum-fill
Round 10: giveup, 50 percent maximum-fill
Round 6: repetition, 70 percent maximum-fill
Round 2: empty, 66 percent maximum-fill
Round 1: empty, 66 percent maximum-fill
Round 3: empty, 100 percent maximum-fill
Round 3: empty, 66 percent maximum-fill
Round 8: repetition, 42 percent maximum-fill
Round 1: empty, 60 percent maximum-fill
Round 2: repetition, 100 percent maximum-fill
Round 2: repetition, 83 percent maximum-fill
Round 4: repetition, 66 percent maximum-fill
Round 6: repetition, 75 percent maximum-fill
Round 4: empty, 66 percent maximum-fill
Round 10: giveup, 61 percent maximum-fill
Round 10: giveup, 56 percent maximum-fill
Round 4: empty, 66 percent maximum-fill
Round 6: repetition, 33 percent maximum-fill
Round 3: empty, 57 percent maximum-fill
Round 3: repetition, 100 percent maximum-fill
Round 6: repetition, 73 percent maximum-fill
Round 10: giveup, 50 percent maximum-fill
Round 6: repetition, 50 percent maximum-fill
Round 10: giveup, 73 percent maximum-fill
Round 5: empty, 80 percent maximum-fill
Round 10: giveup, 61 percent maximum-fill
Round 3: repetition, 53 percent maximum-fill
Round 10: giveup, 33 percent maximum-fill
Round 10: giveup, 80 percent maximum-fill
Round 10: giveup, 63 percent maximum-fill
Round 10: giveup, 70 percent maximum-fill
Round 10: giveup, 84 percent maximum-fill
Round 7: repetition, 70 percent maximum-fill
Round 10: repetition, 57 percent maximum-fill
Round 10: giveup, 55 percent maximum-fill
Round 6: repetition, 36 percent maximum-fill
Round 4: repetition, 75 percent maximum-fill
Round 10: giveup, 72 percent maximum-fill
Round 10: giveup, 64 percent maximum-fill
Round 10: giveup, 84 percent maximum-fill
Round 10: giveup, 58 percent maximum-fill
Round 10: giveup, 60 percent maximum-fill
Round 10: giveup, 53 percent maximum-fill
Round 4: repetition, 40 percent maximum-fill
Round 4: empty, 40 percent maximum-fill
Round 10: giveup, 50 percent maximum-fill
Round 10: giveup, 68 percent maximum-fill