Sh3ll
OdayForums


Server : Apache
System : Linux server1.cgrithy.com 3.10.0-1160.95.1.el7.x86_64 #1 SMP Mon Jul 24 13:59:37 UTC 2023 x86_64
User : nobody ( 99)
PHP Version : 8.1.23
Disable Function : NONE
Directory :  /usr/lib64/python2.7/Demo/scripts/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/lib64/python2.7/Demo/scripts/queens.pyo
�
V
�Qc@sBdZdZddd��YZd�Zedkr>e�ndS(s�N queens problem.

The (well-known) problem is due to Niklaus Wirth.

This solution is inspired by Dijkstra (Structured Programming).  It is
a classic recursive backtracking approach.

itQueenscBsSeZed�Zd�Zdd�Zd�Zd�Zd�ZdZ	d�Z
RS(cCs||_|j�dS(N(tntreset(tselfR((s+/usr/lib64/python2.7/Demo/scripts/queens.pyt__init__s	cCsf|j}dg||_dg||_dgd|d|_dgd|d|_d|_dS(Niii(RtNonetytrowtuptdowntnfound(RR((s+/usr/lib64/python2.7/Demo/scripts/queens.pyRs	icCs�x}t|j�D]l}|j||�r|j||�|d|jkrX|j�n|j|d�|j||�qqWdS(Ni(trangeRtsafetplacetdisplaytsolvetremove(RtxR((s+/usr/lib64/python2.7/Demo/scripts/queens.pyRs
cCs0|j|o/|j||o/|j||S(N(RRR	(RRR((s+/usr/lib64/python2.7/Demo/scripts/queens.pyR&scCs@||j|<d|j|<d|j||<d|j||<dS(Ni(RRRR	(RRR((s+/usr/lib64/python2.7/Demo/scripts/queens.pyR
)s

cCs@d|j|<d|j|<d|j||<d|j||<dS(Ni(RRRRR	(RRR((s+/usr/lib64/python2.7/Demo/scripts/queens.pyR/s

cCs�|jd|_|jrdSdd|jdGHxbt|jddd�D]G}dGx5t|j�D]$}|j||kr�dGqedGqeWdGHqKWdd|jdGHdS(	Nis+-s--t+i����t|tQt.(R
tsilentRRR(RRR((s+/usr/lib64/python2.7/Demo/scripts/queens.pyR7s	 	(t__name__t
__module__tNRRRRR
RRR(((s+/usr/lib64/python2.7/Demo/scripts/queens.pyRs	
			cCs�ddl}d}t}|jdd!dgkrDd}|jd=n|jdrgt|jd�}nt|�}||_|j�dG|jGdGHdS(Ni����iiis-ntFounds
solutions.(tsysRtargvtintRRRR
(RRRtq((s+/usr/lib64/python2.7/Demo/scripts/queens.pytmainFs

	
t__main__N((t__doc__RRRR(((s+/usr/lib64/python2.7/Demo/scripts/queens.pyt<module>
s
8	

ZeroDay Forums Mini