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

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>
            一本久久综合亚洲鲁鲁| 久久精品国产77777蜜臀| 欧美激情小视频| 久久视频在线免费观看| 91久久久久久| 亚洲人成亚洲人成在线观看| 久久久亚洲影院你懂的| 亚洲国产91| 日韩一区二区免费看| 国产精品国产自产拍高清av王其| 亚洲欧美视频在线观看| 午夜欧美大尺度福利影院在线看| 国内揄拍国内精品久久| 久久夜色精品国产欧美乱极品| 久久亚洲春色中文字幕| 日韩天堂在线视频| 亚洲午夜av| 亚洲国产精品久久久久秋霞不卡 | 99精品欧美一区二区三区| 亚洲精品国产精品久久清纯直播 | 国产精品成人免费| 欧美在线亚洲在线| 快she精品国产999| 亚洲性视频网站| 久久国产福利| 一本色道久久88综合亚洲精品ⅰ | 一本色道久久综合狠狠躁篇怎么玩| 国产精品久久久久久福利一牛影视| 久久久综合免费视频| 欧美成人性生活| 欧美主播一区二区三区美女 久久精品人 | 91久久精品美女| 一本色道久久88综合亚洲精品ⅰ| 一区二区三区在线视频播放| 亚洲人成在线观看网站高清| 国产一区导航| 一区二区三区视频在线| 亚洲国产精品专区久久| 亚洲一区二区久久| 99国产精品国产精品毛片| 久久精品免视看| 性欧美暴力猛交69hd| 欧美成人嫩草网站| 久久一二三四| 国产情侣久久| 中文在线一区| 在线视频日本亚洲性| 蜜臀久久99精品久久久画质超高清| 欧美一区二区三区在线| 欧美日韩国产一区二区三区地区 | 亚洲一区二区伦理| 欧美丰满高潮xxxx喷水动漫| 麻豆av一区二区三区| 国产精品狼人久久影院观看方式| 亚洲人成亚洲人成在线观看图片| 在线日韩欧美| 久久精品视频在线播放| 欧美影院午夜播放| 国产精品午夜国产小视频| 一区二区精品在线| 99精品免费视频| 欧美日韩成人一区| 91久久精品日日躁夜夜躁国产| 亚洲电影视频在线| 久久精品视频在线免费观看| 久久琪琪电影院| 国内外成人免费激情在线视频| 欧美在线啊v一区| 久久精品人人做人人爽| 国产亚洲一区在线播放| 99这里只有精品| 久久嫩草精品久久久精品| 国产精品亚洲综合一区在线观看| 日韩亚洲欧美精品| 一区二区三区四区五区在线| 欧美精品激情| 一区二区三欧美| 香蕉久久a毛片| 国产一区二区三区直播精品电影| 欧美在线视频在线播放完整版免费观看 | 欧美成人一区二区三区在线观看| 欧美激情第三页| 在线性视频日韩欧美| 欧美日韩综合在线| 亚洲欧美日本国产专区一区| 久久九九国产精品| 亚洲高清精品中出| 欧美日韩岛国| 亚洲欧美中文另类| 欧美福利一区| 亚洲一区二区三区影院| 国产日韩综合| 欧美成人免费va影院高清| 日韩一区二区高清| 久久精品国产精品亚洲精品| 亚洲国产日韩欧美综合久久| 欧美日韩精品一区二区三区四区| 亚洲欧美激情四射在线日 | 一区二区三区精品久久久| 亚洲欧美综合另类中字| 黄色成人片子| 欧美日韩高清在线播放| 久久大香伊蕉在人线观看热2| 亚洲国产导航| 欧美在线综合视频| 亚洲毛片一区| 国内精品久久国产| 欧美日韩视频| 麻豆91精品| 亚洲女人天堂av| 亚洲精品视频一区| 麻豆国产精品777777在线| 亚洲网站在线看| 亚洲国产99| 国产一区白浆| 国产精品美女久久久久久2018 | 欧美freesex8一10精品| 亚洲欧美日韩国产中文在线| 亚洲茄子视频| 欧美xart系列高清| 久久久久高清| 亚洲欧美第一页| 夜夜嗨av一区二区三区免费区| 伊人久久综合| 国产在线精品二区| 国产精品美女久久久久av超清| 欧美劲爆第一页| 毛片一区二区三区| 欧美影院精品一区| 亚洲欧美日韩一区在线观看| 亚洲精品日韩欧美| 亚洲第一毛片| 欧美gay视频激情| 久久婷婷国产麻豆91天堂| 亚洲欧美资源在线| 午夜激情久久久| 亚洲欧美日韩精品一区二区| 亚洲少妇自拍| 亚洲一区二区欧美日韩| 99国产精品| 99亚洲一区二区| 一本色道精品久久一区二区三区 | 国产精品久久看| 国产精品美女久久福利网站| 欧美色视频日本高清在线观看| 欧美日本一区二区三区 | 久久精品91久久久久久再现| 亚洲欧美日韩国产综合精品二区| 亚洲一区免费观看| 亚洲欧美日韩一区二区三区在线观看| 99视频在线观看一区三区| 一本色道久久综合一区| 一区二区三欧美| 亚洲欧美精品在线| 亚洲欧美日韩精品在线| 性色av一区二区三区在线观看 | 欧美高清在线精品一区| 欧美www在线| 欧美日韩一级大片网址| 国产精品xnxxcom| 国产乱码精品一区二区三区av| 国产午夜亚洲精品羞羞网站| 狠狠色狠狠色综合日日tαg| 亚洲黄色高清| 亚洲视频在线观看视频| 午夜精品亚洲| 毛片一区二区| 亚洲理论在线观看| 亚洲一区视频在线| 久久久久久综合| 欧美日韩一区高清| 国产日韩欧美一区| 亚洲国产午夜| 午夜精品一区二区三区四区| 久久久久久九九九九| 亚洲电影视频在线| 亚洲校园激情| 久久影院午夜论| 国产精品xxx在线观看www| 韩国av一区二区三区| 亚洲毛片在线观看.| 先锋影院在线亚洲| 亚洲国产成人久久综合一区| 亚洲淫片在线视频| 欧美成人一区二区三区| 国产欧美日韩视频在线观看| 亚洲久久一区| 久久久久久一区二区三区| 亚洲日本va午夜在线影院| 性欧美xxxx大乳国产app| 欧美高清影院| 樱桃成人精品视频在线播放| 亚洲私人黄色宅男| 欧美国产综合一区二区| 亚洲欧美资源在线| 欧美日韩亚洲系列| 亚洲欧洲日韩在线| 久久综合伊人77777蜜臀| 99精品久久免费看蜜臀剧情介绍| 狼狼综合久久久久综合网|