الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

Marathon Match

مغلق
بدأه bachirk في 9 يونيو 2007 · 2 رد · 1,188 مشاهدة · في الرياضيات والخوارزميات
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

السلام عليكم

Marathon Match هي مسابقة شهرية تقيمها google

حيث انها تتيح للمشترك فرصة زمنية اطول تقدر ما بين

اسبوع او اسبوعين لايجاد حل خورزمية

لكن مستوى الخورزميات اصعب في Marathon Match

منه في مسابقة algorithm

المسابقة القادمة يوم 13 من هذا الشهر

ولديك اسبوع لايجاد حل السؤال .

للاطلاع على المسابقات لهذا الشهر تجدها في هذا الرابط

Marathon Match

#2

هذه احد المسائل المطروحة في المسابقة

وهي عبارة عن لعبة فردية تلعب على جدول مكون من 81

ابعاده 9 على 9

الهدف من اللعبة هو تحقيق اكبر عدد من النقاط قبل امتلاء الجدول

وتستطيع افراغ الجدول بصف الاعداد المتشابهة مع بعض عموديا وافقيا

وتستطيع تحريك القطع من خانة الى اخرى فارغة بشرط ان يكون هناك اتصال

اي هناك طريق من الخانات الفارغة يصل بينهما تستطيع لعب اللعبة على الموقع

لعبة linez

هذه المسألة هي كاختبار فقط لان المهلة المحددة لحلها انتهت

لكن تستطيع المشاركة في المسألة القادمة بعد 4 ايام

ارجوا من الجميع المشاركة بافكارهم

Problem Statement

Linez is a single-player board game played on a 9x9 grid. On each turn, the player must move one of the numbers on the board to an empty cell where a clear path (consisting of horizontally connected or vertically connected empty cells) exists between the new position and the old. If five or more same numbers are aligned in a row, column, or diagonal, they will be removed from the board. The player will gain 10+k*(k-5)/2 points (k being the number of removals) and can make another move. Otherwise, three more numbers will be placed onto the board at randomly chosen positions before the player can move again. The objective is to score as many points as possible before the whole board fills up. (An online version of the Linez game is available at http://linez.varten.net/.)

Your task is to write a class to play the Linez game. The method nextMove will be given the board configuration and the next three numbers. board will contain 9 Strings representing the rows of the board from top to bottom. Each element will contain 9 characters. Each character will be '1' to '7' representing the number on that cell, or '.' if that position is unoccupied. nextThree will contain 3 characters. Each element of nextThree will be '1' to '7' representing the number to be added to the board next turn. The return value of nextMove must contain 4 characters, the first two representing the original position of the number to be moved, the next two representing the target position. For example, to move the number "4" from "I8" to "F6" as shown below, return "I8F6".



You will have a total of 20 seconds for each test case. The memory limit is 64MB. Your final score will be the mean score on all the test cases.

Definition
			Class:	Linez
Method:	nextMove
Parameters:	String[], String
Returns:	String
Method signature:	String nextMove(String[] board, String nextThree)
(be sure your method is public)




Notes
-	Each number of nextThree will be chosen uniformly between 1 and 7, inclusive.
-	Each empty cell has an equal probability to be chosen when the next number is added to the board.
-	If your solution crashes, runs out of time, or tries to make an invalid move it will receive the points it has made so far for that test case.

Examples
0)	
			board:
{
  ".........",
  ".....4...",
  ".........",
  "......5..",
  ".........",
  ".........",
  "......3..",
  ".........",
  "........."
}
nextThree:
  "545"



1)	
			board:
{
  ".........",
  ".........",
  ".......5.",
  "3........",
  ".........",
  ".........",
  ".........",
  "....7....",
  "........."
}
nextThree:
  "773"



2)	
			board:
{
  "..6.....4",
  ".........",
  ".........",
  ".........",
  ".........",
  "...1.....",
  ".........",
  ".........",
  "........."
}
nextThree:
  "154"



3)	
			board:
{
  ".........",
  ".........",
  ".........",
  ".........",
  "7........",
  ".........",
  ".........",
  ".........",
  "..6....2."
}
nextThree:
  "563"



4)	
			board:
{
  ".6.......",
  ".....6...",
  ".4.......",
  ".........",
  ".........",
  ".........",
  ".........",
  ".........",
  "........."
}
nextThree:
  "745"



5)	
			board:
{
  ".........",
  ".........",
  ".6.4.....",
  "........6",
  ".........",
  ".........",
  ".........",
  ".........",
  "........."
}
nextThree:
  "151"



6)	
			board:
{
  ".........",
  ".........",
  "......3..",
  "..3......",
  ".........",
  ".........",
  "..2......",
  ".........",
  "........."
}
nextThree:
  "455"



7)	
			board:
{
  ".........",
  ".........",
  ".....1...",
  ".........",
  ".6.......",
  "......5..",
  ".........",
  ".........",
  "........."
}
nextThree:
  "527"


8)	
			board:
{
  ".2.......",
  ".........",
  ".........",
  ".........",
  "...6.....",
  ".........",
  ".......1.",
  ".........",
  "........."
}
nextThree:
  "564"


9)	
			board:
{
  "........2",
  ".........",
  ".........",
  ".........",
  ".....2...",
  ".........",
  ".........",
  "....5....",
  "........."
}
nextThree:
  "624"

تم تعديل هذه المشاركة بواسطة bachirk في 9 يونيو 2007 في 21:08

#3

للرفع

أضاعوني وأي فتى أضاعـوا * * * ليـوم كــريهـة وســـداد ثغــــر

وخـــــلونـي ومعتـرك المنايـا * * * وقد شـــرعوا أسنــتهم لنحـري

كأني لم أكــــــن فيهـم وسيطـا * * * ولم تك نســبتي في آل عمــرو

أجرر في الجـــوامع كـل يـوم * * * ألا لله مظــــلمتـي وهـصـــري

عسى الملك المجيب لمن دعاه * * * سينجيني فيعلم كيــف شكـري

فأجـــزي بالكرامـة أهـل ودي * * * وأجزي بالضـغينة أهل ضري

منتديات الرياضيات العربية

هذا الموضوع مغلق.

مواضيع مشابهة