当前位置:   article > 正文

FZU2266 Card Game (Third Edition)(模拟)_nhentai

nhentai

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
2
1
5
6
2
3 4
3 4
Sample Output
Case 1: 1
Case 2: 0


题意:胖兄还是那个胖兄,(妹子还是那个妹子)(没毛病啊前面的你删个什么0.0

这次玩的游戏是每人有一堆牌(有顺序),按照顺序每人拿出一张牌,如果两张牌的和大于10则胖兄赢,问胖兄赢几局


解题思路:

你就直接@$&^!%$#*!@^$*#...模拟不完了(反手一巴掌( ̄ε(# ̄)☆╰╮o( ̄皿 ̄///)


AC代码:

  1. #include<stdio.h>
  2. int a[10010],b[10010];
  3. int main()
  4. {
  5. int t,tt=1,n;
  6. scanf("%d",&t);
  7. while(t--)
  8. {
  9. scanf("%d",&n);
  10. for(int i=0;i<n;i++)
  11. {
  12. scanf("%d",&a[i]);
  13. }
  14. for(int i=0;i<n;i++)
  15. {
  16. scanf("%d",&b[i]);
  17. }
  18. int cnt=0;
  19. for(int i=0;i<n;i++)
  20. {
  21. if(a[i]+b[i]>10) cnt++;
  22. }
  23. printf("Case %d: ",tt++);
  24. printf("%d\n",cnt);
  25. }
  26. return 0;
  27. }





看见水题还是那么亲切,嘿嘿。

(首先得看懂水题Orz)

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/我家小花儿/article/detail/471332
推荐阅读
相关标签
  

闽ICP备14008679号