2266 Card Game (Third Edition)
来源:互联网 发布:域名添加解析 编辑:程序博客网 时间:2024/06/05 02:47
Accept: 107 Submit: 175
Time Limit: 1000 mSec Memory Limit : 32768 KB
Problem Description
Fat brother and Maze are playing a kind of special (hentai) game with some cards. In this game, every player gets N cards at first and these are their own card decks. Each of these two decks of cards is stacking together at the beginning of the game, and their order would not change during this game. The game goes for N rounds and in each round, Fat Brother and Maze would draw one card from the top of their own remaining card deck and sum these two integers together. If this number is greater than 10, Fat Brother would score 1 victory point and otherwise Maze would score 1 victory points. And then these two cards are removed from the game such that they would not appear in the later rounds. As we all know, Fat Brother is very clever, so he would like to know the number of the victory points he could get if he knows all the integers written in these cards. At the beginning of this game, each player has 0 victory point.
Input
The first line of the date is an integer T (1 <= T <= 100), which is the number of the text cases.
Then T cases follow, each case contains an integer N (1 <= N <= 10000) which described before. Then follow two lines with N integers each. The first N integers indicate the cards which Fat Brother gets from top to bottom, and the second N integers indicate the cards which Maze gets from top to bottom.
All the integers are positive and least than 10.
Output
For each case, output the case number first, and then output the number of victory points Fat Brother would gets in this game.
Sample Input
Sample Output
Source
第七届福建省大学生程序设计竞赛-重现赛(感谢承办方闽江学院)- 2266 Card Game (Third Edition)
- 2264 Card Game (First Edition)
- 2265 Card Game (Second Edition)
- 【期望】fuzoj 2265 Card Game (Second Edition)
- FZU 2264 Card Game (First Edition)(数学概率题)
- Professional C# Third Edition
- Java Threads, Third Edition
- Pro JSP, Third Edition
- UNIX, Third Edition
- Third Edition Resources
- NET Framework Essentials, Third Edition
- Beginning Linux Programming, Third Edition
- Mastering Enterprise JavaBeans, Third Edition
- Data Modeling Essentials, Third Edition
- Unix Shell Programming, Third Edition
- Java Network Programming, Third Edition
- Beginning Ubuntu Linux, Third Edition
- Beginning Linux Programming Third Edition
- 查询Java中CPU使用率最高的线程
- 在App中启动另一个App的实现方式
- Leetcode496. Next Greater Element I
- VMware12+ubuntu16.04图文记录
- 多表联合查询(join、union等)
- 2266 Card Game (Third Edition)
- D
- javaAPI(4)之DateFormat,Date,Calendar类的使用创建日历
- scala中option、None、some对象
- B
- 通过用户输入的年份与月份来算显示当月的日历
- 工作流引擎
- Centos 7 jdk的安装及环境变量的配置
- bmap地图api删除路线