2012年5月 的存档

计算电磁学笔记

2012年5月26日 1 条评论

今天把研究生时候做的一套笔记放上来了,有兴趣的同学可以看看:

http://www.jlao.net/emnotes

Sudoku Solution – Project Euler #96

2012年5月3日 没有评论

This is a Python solution for Project Euler #96, to find the solution for sudokus.

The speed is modest (0.750s with pypy on Windows 7 @ i5 2.60GHz), but the code is relatively short and hopefully the idea is clear. Enjoy.
1. Find candidates for all items. If only one exists for a blank, fill it in.
2. Note down the blank with least but more than one candidates.
3. Copy the matrix and trial the candidates recursively until all blanks are filled.
阅读全文…