青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

oyjpArt ACM/ICPC算法程序設計空間

// I am new in programming, welcome to my blog
I am oyjpart(alpc12, 四城)
posts - 224, comments - 694, trackbacks - 0, articles - 6

PKU1568 Find the Winning Move

Posted on 2007-03-02 17:50 oyjpart 閱讀(1630) 評論(2)  編輯 收藏 引用 所屬分類: ACM/ICPC或其他比賽

Find the Winning Move
Time Limit:3000MS  Memory Limit:32768K
Total Submit:120 Accepted:67

Description
4x4 tic-tac-toe is played on a board with four rows (numbered 0 to 3 from top to bottom) and four columns (numbered 0 to 3 from left to right). There are two players, x and o, who move alternately with x always going first. The game is won by the first player to get four of his or her pieces on the same row, column, or diagonal. If the board is full and neither player has won then the game is a draw.
Assuming that it is x's turn to move, x is said to have a forced win if x can make a move such that no matter what moves o makes for the rest of the game, x can win. This does not necessarily mean that x will win on the very next move, although that is a possibility. It means that x has a winning strategy that will guarantee an eventual victory regardless of what o does.

Your job is to write a program that, given a partially-completed game with x to move next, will determine whether x has a forced win. You can assume that each player has made at least two moves, that the game has not already been won by either player, and that the board is not full.

Input
The input contains one or more test cases, followed by a line beginning with a dollar sign that signals the end of the file. Each test case begins with a line containing a question mark and is followed by four lines representing the board; formatting is exactly as shown in the example. The characters used in a board description are the period (representing an empty space), lowercase x, and lowercase o. For each test case, output a line containing the (row, column) position of the first forced win for x, or '#####' if there is no forced win. Format the output exactly as shown in the example.

Output
For this problem, the first forced win is determined by board position, not the number of moves required for victory. Search for a forced win by examining positions (0, 0), (0, 1), (0, 2), (0, 3), (1, 0), (1, 1), ..., (3, 2), (3, 3), in that order, and output the first forced win you find. In the second test case below, note that x could win immediately by playing at (0, 3) or (2, 0), but playing at (0, 1) will still ensure victory (although it unnecessarily delays it), and position (0, 1) comes first.

Sample Input

?
....
.xo.
.ox.
....
?
o...
.ox.
.xxx
xooo
$

 

 

 

Sample Output

#####
(0,1)

 

 

 

Source
Mid-Central USA 1999

這個博弈 我用了Alpha-Beta剪枝 搜索是標準的極大極小的搜索過程
hash用的是4進制的便于位運算的hash

 

Feedback

# re: PKU1568 Find the Winning Move   回復  更多評論   

2007-03-11 19:08 by nick
const int MAX = (1<<24)+1;

MAX 不是應該是 (1<<28)

因為扣掉一開始盤面上一定有兩個子以上 4*4-2 = 14
然後 2*14 = 28

為什麼是 1<<24 呢?

# re: PKU1568 Find the Winning Move   回復  更多評論   

2007-03-11 19:40 by oyjpart
[quote] "You can assume that each player has made at least two moves, ..."
which means that there must be 4 moves at the beginning :)
青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            亚洲伊人一本大道中文字幕| 欧美在线播放高清精品| 欧美成人激情视频免费观看| 亚洲国产精品久久精品怡红院| 开心色5月久久精品| 久久另类ts人妖一区二区| 伊人激情综合| 最新高清无码专区| 欧美日韩国产区| 亚洲欧美激情视频在线观看一区二区三区| 中国女人久久久| 国产一区二区成人久久免费影院| 乱中年女人伦av一区二区| 欧美96在线丨欧| 亚洲欧美国产va在线影院| 亚洲一区图片| 亚洲高清色综合| 日韩一区二区久久| 国产亚洲午夜| 亚洲精品国产精品国产自| 国产精品久久97| 牛人盗摄一区二区三区视频| 欧美日韩国产在线一区| 久久九九99视频| 欧美人与性动交cc0o| 久久九九国产| 欧美日韩在线影院| 欧美~级网站不卡| 国产精品av久久久久久麻豆网| 久久久九九九九| 欧美日韩精品系列| 欧美xart系列在线观看| 国产精品二区在线观看| 欧美xxxx在线观看| 国产欧美日韩一区二区三区在线 | 国产亚洲二区| 亚洲日本中文| 在线国产欧美| 亚洲尤物在线| 亚洲视频一区二区| 久久亚洲私人国产精品va| 亚洲欧美日本日韩| 欧美高清视频在线播放| 久久久人人人| 国产色爱av资源综合区| 日韩午夜在线电影| 亚洲精品国产精品乱码不99| 久久精品国产亚洲一区二区| 亚洲欧美一区二区三区极速播放| 男女av一区三区二区色多| 久久久午夜视频| 国产精品一区二区久久| 一区二区日韩精品| 一区二区三区.www| 欧美精品二区| 91久久精品日日躁夜夜躁国产| 好吊日精品视频| 久久国产精品色婷婷| 久久成人精品无人区| 国产精品分类| 亚洲在线电影| 久久成人精品电影| 国产免费成人在线视频| 亚洲系列中文字幕| 亚洲欧美另类在线观看| 国产精品久久久久久一区二区三区 | 亚洲一区二区三区影院| 欧美精品偷拍| 亚洲美女黄色| 亚洲香蕉成视频在线观看| 欧美日韩国产黄| 99国产成+人+综合+亚洲欧美| 一区二区三区精品视频在线观看| 欧美黄在线观看| 9久草视频在线视频精品| 亚洲午夜精品久久久久久app| 欧美色图一区二区三区| 亚洲深夜激情| 久久精品99无色码中文字幕| 一区二区三区在线视频免费观看| 久久久亚洲成人| 亚洲国产精品一区二区www| 日韩小视频在线观看| 欧美性事免费在线观看| 午夜精品亚洲| 欧美激情视频一区二区三区免费| 亚洲精品专区| 国产精品日韩欧美大师| 欧美一区综合| 亚洲国产精品热久久| 亚洲一区二区伦理| 国产亚洲精品久久久久婷婷瑜伽| 久久欧美中文字幕| 亚洲精品一区二区三区蜜桃久| 亚洲欧美在线看| 1024成人网色www| 欧美日韩精品在线观看| 欧美一级网站| 亚洲福利av| 午夜一区二区三区在线观看 | 国产精品极品美女粉嫩高清在线 | 亚洲一区亚洲二区| 免费成人av在线| 亚洲一区二区三区在线播放| 国产在线不卡视频| 欧美日韩国产影院| 久久av一区二区| 99国产精品国产精品久久| 久久九九久久九九| 在线亚洲激情| 亚洲国产美女精品久久久久∴| 国产精品久久久久久久久动漫| 久久天天狠狠| 午夜精品久久久久| 亚洲三级性片| 欧美国产日韩精品| 久久成人亚洲| 一区二区三区日韩精品视频| 一区二区三区中文在线观看| 国产精品久久国产愉拍 | 欧美在线影院在线视频| 亚洲精品精选| 欧美成人小视频| 久久久久久久激情视频| 亚洲永久免费| aⅴ色国产欧美| 伊人激情综合| 精品动漫一区二区| 国产伦精品一区二区三区四区免费| 欧美极品在线观看| 蜜桃av久久久亚洲精品| 久久久久久网| 久久免费高清| 久久人人爽人人爽| 久久九九久精品国产免费直播| 亚洲男女自偷自拍| 亚洲一区二区在线免费观看| 一区二区国产日产| 日韩亚洲精品电影| 亚洲美女毛片| 亚洲美女一区| 一区二区三区导航| 在线一区二区视频| 亚洲性图久久| 亚洲欧美日韩国产另类专区| 亚洲一区视频| 欧美中文在线视频| 久久久999精品| 久久久久免费视频| 蜜臀91精品一区二区三区| 老司机午夜免费精品视频| 麻豆精品一区二区综合av| 久久婷婷激情| 欧美高清hd18日本| 欧美日韩国产亚洲一区| 欧美特黄一级大片| 国产精品系列在线播放| 国产婷婷色一区二区三区四区| 国产午夜精品一区理论片飘花 | 欧美女同在线视频| 欧美日韩一区二区免费在线观看| 欧美深夜福利| 国产私拍一区| 亚洲国产三级在线| 在线亚洲国产精品网站| 欧美一级久久久| 美玉足脚交一区二区三区图片| 欧美激情无毛| 亚洲视频一区二区| 欧美在线视频在线播放完整版免费观看 | 午夜精品国产| 免费91麻豆精品国产自产在线观看| 免费看成人av| 一本色道久久88精品综合| 亚洲欧美国产一区二区三区| 久久久久一区二区| 欧美精品一区在线| 国产一区二区毛片| 亚洲精品乱码久久久久久按摩观| 亚洲欧美bt| 欧美成人中文字幕| 亚洲视频精品| 美日韩丰满少妇在线观看| 国产精品成人在线| 在线看无码的免费网站| 亚洲天堂成人在线观看| 蜜桃久久av一区| 亚洲午夜精品视频| 免费黄网站欧美| 国产欧美一区在线| 一本色道久久加勒比精品| 久久久久久色| 亚洲一区二区三区777| 另类尿喷潮videofree| 国产欧美日韩三级| 99国产欧美久久久精品| 美日韩精品视频免费看| 亚洲欧美日本另类| 欧美特黄一级| 一区二区三区视频免费在线观看|