文档下载 文档下载导航
设为首页 | 加入收藏
搜索 请输入内容:  
 导航当前位置: 文档下载 > 所有分类 > IT/计算机 > ACM竞赛试题(英文)
侵权投诉

ACM竞赛试题(英文)

re is a sample graph according to the first test case in the sample input:

Input
The first line is the number of test cases.
In each test case, the first line contains two integers n and m( 1 <= n <= 1000, 0 <= m <= 1000).,meaning that the cube is n x n x n and there are m eliminations.

Each of the following m lines represents an elimination in the following format:
axis_1=a, axis_2=b
where axis_i (i=1, 2) is ‘X’ or ‘Y’, or ‘Z’ and axis_1 is not equal to axis_2. a and b are 32-bit signed integers.
Output
For each test case output the number of eliminated blocks.
Sample Input
2
3 2
Y=1,Z=3
X=3,Y=1
10 2
X=3,Y=3
Y=3,Z=3

Sample Output
5
19



Problem D. Gomoku
Description
You are probably not familiar with the title, “Gomoku”, but you must have played it a lot. Gomoku is an abstract strategy board game and is also called Five in a Row, or GoBang. It is traditionally played with go pieces (black and white stones) on a go board (19x19 intersections). Nowadays, standard chessboard of Gomoku has 15x15 intersections. Black plays first, and players alternate in placing a stone of their color on an empty intersection. The winner is the first player to get an unbroken row of five or more stones horizontally, vertically, or diagonally.


For convenience, we coordinate the chessboard as illustrated above. The left-bottom intersection is (0,0). And the bottom horizontal edge is x-axis, while the left vertical line is y-axis.

I am a fan of this game, actually. However, I have to admit that I don’t have a sharp mind. So I need a computer program to help me. What I want is quite simple. Given a chess layout, I want to know whether someone can win within 3 moves, assuming both players are clever enough. Take the picture above for example. There are 31 stones on it already, 16 black ones and 15 white ones. Then we know it is white turn. The white player must place a white stone at (5,8). Otherwise, the black player will win next turn. After that, however, the white player also gets a perfect situation that no matter how his opponent moves, he will win at the 3rd move.

So I want a program to do similar things for me. Given the number of stones and positions of them, the program should tell me whose turn it is, and what will happen within 3 moves.
Input
The input contains no more than 20 cases.
Each case contains n+1 lines which are formatted as follows.
n
x1 y1 c1
x2 y2 c2
......
xn yn cn
The first integer n indicates the number of all stones. n<=222 which means players have enough space to place stones. Then n lines follow. Each line contains three integers: xi and yi and ci. xi and yi are coordinates of the stone, and ci means the color of the stone. If ci=0 the stone is white. If ci=1 the stone is black. It is guaranteed that 0<=xi,yi<=14, and ci=0 or 1. No two stones are placed at the same position. It is also guaranteed that there is no five in a row already, in the given cases.
The inp

上一页第3页

热门文档

相关文档

  • ACM英文试题

    ACM英文试题_工学_高等教育_教育专区。ACM International Collegiate Programming Contest Problem One: Jogging Trails Gord is training for aACM International ...

  • 2009年acm竞赛试题[1]

    2009年acm竞赛试题[1]_IT/计算机_专业资料。竞赛题基隆商工校内 ACM_第 25 ...每个样本是由 1 个英文字再加上 9 个数字所组成的字符 串。 【输出文件格式...

  • ACM竞赛练习题

    百度文库 教育专区 外语学习 英语考试专题推荐 北师大二附理科学霸高中... 东北... ACM竞赛之输入输出 3页 1下载券 ACM竞赛试题集锦 3页 免费 ACM竞赛讲座之一...

  • ACM竞赛试题集锦

    ACM竞赛试题集锦_IT/计算机_专业资料。ACM竞赛试题集锦取石子游戏 Time Limit:1S Memory Limit:1000K Total Submit:505 Accepted:90 Description 有两堆石子,数量...

  • 第三届ACM竞赛试题

    2010 年 5 月 16 日 所有的题目 时间限制: 1 秒 【试题一】 房间安排 ... 第三届河南省acm竞赛(正... 10页 免费 ACM竞赛试题(英文) 6页 免费 第...

  • ACM程序大赛选拔初赛试题 - 参考答案

    ACM程序大赛选拔初赛试题 - 参考答案_其它考试_资格考试/认证_教育专区。很好...1、字母排序 难度系数:★☆☆☆ 题意:有 10 个英文字母(包含大小写),用计算机...

  • 2009年acm竞赛试题

    2009年acm竞赛试题_IT/计算机_专业资料。2009年acm竞赛试题,可以通过这些题的...应该很多人都知道,我们的身份证是由 1 个英文字,再加上 9 个数字所组成....

  • 杭电acm题目水题英文题目、翻译及ac源代码

    杭电acm题目水题英文题目、翻译及ac源代码_计算机软件及应用_IT/计算机_专业资料。如题。供无网人士享用。今日推荐 157份文档 2015国家公务员考试备战攻略...

  • ACM试题解析-1

    此题虽为 ACM 比赛用题,却非常简单,没有什么特别之处,不牵扯数据结构, 实为初学者建立自信心的灵丹妙药。 英文原文 P1 - ACM SPPC 1 of 2 Saturday, 20/...

  • ACM竞赛讲座

    ACM竞赛讲座_IT/计算机_专业资料。ACM讲座? ACM大学生程序设计 竞赛浅谈 ACM/...竞赛 时,每队三人仅拥有一台计算机,在五个小时内,解答5~10道题目(题目是英文...

站点地图 | 文档上传 | 侵权投诉 | 手机版
本站所有资源均来自互联网,本站只负责收集和整理,均不承担任何法律责任,如有侵权等其它行为请联系我们.
文档下载 Copyright 2013 doc.guandang.net All Rights Reserved.  -  email