USACO2018open Bronze试题

这里是USACO2018全美公开赛铜组的试题,题解USACO上有,鄙人不才。

USACO 2018 US Open Contest, Bronze

The bronze division had 812 total participants, of whom 657 were pre-college students. All competitors who scored 700 or higher on this contest are automatically promoted to the silver division. Detailed results for all those promoted are here.

1

Team Tic Tac Toe
View problem  |   Test data   |   Solution

2

Milking Order
View problem  |   Test data   |   Solution

3

Family Tree
View problem  |   Test data   |   Solution
题解USACO上有详细的,在Solution里


USACO 2018 US Open Contest, Bronze

Problem 1. Team Tic Tac Toe

Return to Problem List
Contest has ended.

Analysis mode


English (en)Armenian (hy)French (fr)Russian (ru)Spanish (es)Chinese (zh)
Farmer John owns 26 cows, which by happenstance all have names starting with different letters of the alphabet, so Farmer John typically refers to each cow using her first initial -- a character in the range AZ A…Z.

The cows have recently become fascinated by the game of tic-tac-toe, but since they don't like the fact that only two cows can play at a time, they have invented a variant where multiple cows can play at once! Just like with regular tic-tac-toe, the game is played on a 3×3 3×3 board, only instead of just Xs and Os, each square is marked with a single character in the range AZ A…Z to indicate the initial of the cow who claims that square.

An example of a gameboard might be:

COW
XXO
ABC

The cows fill in each of the nine squares before they become confused about how to figure out who has won the game. Clearly, just like with regular tic-tac-toe, if any single cow has claimed an entire row, column, or diagonal, that cow could claim victory by herself. However, since the cows think this might not be likely given the larger number of players, they decide to allow cows to form teams of two, where a team of two cows can claim victory if any row, column, or diagonal consists only of characters belonging to the two cows on the team, and moreover if characters from both cows (not just one) are used in this row, column, or diagonal.

Please help the cows figure out how many individuals or two-cow teams can claim victory. Note that the same square on the game board might possibly be usable in several different claims to victory.

INPUT FORMAT (file tttt.in):
The input consists of three lines, each of which is three characters in the range AZ A…Z.

<

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值