최대 크기가 5 x 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 개의 시작 상태를 포함합니다. 이미 언급했듯이 보드의 크기는 다양합니다. 행 수는 1에서 5까지의 숫자 n으로 표시되며 'x'와 'o'만 포함 된 n 개의 행이 시작 패턴을 나타냅니다. 보드의 모든 행에는 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
8 일 후에는 가장 적은 문자로 작업 답변을 승자로 표시합니다. 또한 100 개의 시작 보드 (입력)에 대한 올바른 출력을 게시합니다.
선호하는 (프로그래밍 / 스크립팅 / 어쨌든) 언어를 사용할 수 있습니다.
즐기세요!
추신 : 질문이 있으시면 언제든지 문의하십시오.
PPS : 독창적 인 제작자 : 독일어를 할 줄 아는 사람들의 경우, 여기에 스포일러를 원하지 않으면 클릭 하지 마십시오 . 도전을 완료하기위한 공식 시간이 끝났으므로, 누군가가 짧고 우아한 해결책을 제시 할 수 있는지 알고 싶었습니다.
2014 년 4 월 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