设为首页 加入收藏

TOP

Codeforces 443A Borya and Hanabi(暴力)
2015-07-24 05:49:44 来源: 作者: 【 】 浏览:3
Tags:Codeforces 443A Borya and Hanabi 暴力

题目链接:Codeforces 443A Borya and Hanabi

题目大意:有若干个牌,每张牌有花色和数字两个值,现在问说至少询问多少次才能区分出所有的牌,每次询问可以确定一种花色牌的位置,或者是一种数字牌的位置。

解题思路:暴力枚举需要问的花色和数字,210,然后枚举两两判断是否可以被区分。

#include 
   
     #include 
    
      #include 
     
       using namespace std; const int N = 105; int n, l[N], r[N]; inline int cal (char ch) { if (ch == 'B') return 0; else if (ch == 'Y') return 1; else if (ch == 'W') return 2; else if (ch == 'G') return 3; else if (ch == 'R') return 4; return -1; } int bit (int i) { return 1<
      
       = ans) continue; if (judge(i)) ans = cnt; } printf("%d\n", ans); return 0; }
      
     
    
   
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇HDU 1317 XYZZY 下一篇Codeforces 442B Andrey and Prob..

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: