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

ACM竞赛试题(英文)

ut is ended by n=0.
Output
For each test case:

First of all, the program should check whose turn next. Let’s call the player who will move next “Mr. Lucky”. Obviously, if the number of the black stone equals to the number of white, Mr. Lucky is the black player. If the number of the black stone equals to one plus the numbers of white, Mr. Lucky is the white player. If it is not the first situation or the second, print “Invalid.”

A valid chess layout leads to four situations below:

1) Mr. Lucky wins at the 1st move. In this situation, print :

Place TURN at (x,y) to win in 1 move.

“TURN” must be replaced by “black” or “white” according to the situation and (x,y) is the position of the move. If there are different moves to win, choose the one where x is the smallest. If there are still different moves, choose the one where y is the smallest.

2) Mr. Lucky’s opponent wins at the 2nd move. In this situation, print:

Lose in 2 moves.

3) Mr. Lucky wins at the 3rd move. If so, print:

Place TURN at (x,y) to win in 3 moves.

“TURN” should replaced by “black” or “white”, (x,y) is the position where the Mr. Lucky should place a stone at the 1st move. After he place a stone at (x,y), no matter what his opponent does, Mr. Lucky will win at the 3rd step. If there are multiple choices, do the same thing as described in situation 1.

4) Nobody wins within 3 moves. If so, print:

Cannot win in 3 moves.
Sample Input
31
3 3 1
3 4 0
3 5 0
3 6 0
4 4 1
4 5 1
4 7 0
5 3 0
5 4 0
5 5 1
5 6 1
5 7 1
5 9 1
6 4 1
6 5 1
6 6 0
6 7 1
6 8 0
6 9 0
7 5 1
7 6 0
7 7 1
7 8 1
7 9 0
8 5 0
8 6 1
8 7 0
8 8 1
8 9 0
9 7 1
10 8 0
1
7 7 1
1
7 7 0
0
Sample Output
Place white at (5,8) to win in 3 moves.
Cannot win in 3 moves.
Invalid.



Problem E. Gunshots
Description
President Bartlet was shot! A group of terrorists shot to the crowd when President Bartlet waved to cheering people after his address. Many people were shot by the irrational bullets. Senior FBI agent Don Epps takes responsibility for this case. According to a series of crime scene investigation, including analyzing shot shells, replaying video from closed-circle television and collecting testimony by witnesses, Don keeps all the information about where and how the terrorists shot to crowd, as well as the location of every single person when the gun shoot happened. Now he wants to know how many gunshot victims are there in this case.

Imagine that each target person can be regarded as a polygon (can be concave or self-intersecting) and each gunshot can be regarded as a half-line. The bullet will be stopped by the first person it shoots. A person can be shot in three ways:
To simplify the problem, we assume that any two polygons can be completely separated by a line. Also each start point of the gunshot can be separated from each polygon by a line. Now given M people and N gunshots, please work out whic

上一页第4页

热门文档

相关文档

  • 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