TC SRM 664 div2 B BearPlaysDiv2 bfs】的更多相关文章

BearPlaysDiv2 Problem Statement    Limak is a little bear who loves to play. Today he is playing by moving some stones between three piles of stones. Initially, the piles contain A, B, and C stones, respectively. Limak's goal is to produce three equa…
 BearCheats Problem Statement    Limak is an old brown bear. Because of his bad eyesight he sometimes has to visit his doctor, Dr. Carrot. Today is one such day. Dr. Carrot has a blackboard in his office. There is a number A written on the blackboard…
A题,熊孩子测视力,水题,题意就是判断一下两个数对应位不相同的数字有多少个. #include<bits/stdc++.h> using namespace std; class BearCheats{ public: string eyesight(int A, int B){ ],digB[]; ; while(A){ digA[t++] = A%; A/=; } ; i < t; i++){ digB[i] = B%; B/=; } ; ; i < t; i++){ if(d…
AABB Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 TC Description One day, Jamie noticed that many English words only use the letters A and B. Examples of such words include "AB" (short for abdominal), "BAA" (the noise a sheep makes), &…
ChessFloor Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 TC Description Samantha is renovating a square room. The floor of the room is an N times N grid of unit square tiles. Each tile has some color. You are given the current colors of all tiles in a…
LuckyXorTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 TC Description A lucky number is a positive integer consisting of only the digits 4 and 7.Given an int a, return an int b strictly greater than a, such that a XOR b is a lucky number. (See Notes fo…
很棒的DP,不过没想出,看题解了..思维很重要. #include <iostream> #include <cstdio> #include <cstring> #include <vector> #include <cmath> #include <algorithm> using namespace std; ]; ]; class MayTheBestPetWin { public : int calc(vector <…
很不错的一题,非常巧妙的用DP顺序解决这个问题... 可以发现,只和A里面最小的有关系... #include <cstdio> #include <cstring> #include <queue> #include <string> #include <vector> #include <algorithm> using namespace std; #define LL long long *+]; vector<int&…
100的数据直接暴力就行,想多了... ac的代码: #include <iostream> #include <cstdio> #include <cstring> #include <cstdlib> #include <cmath> #include <algorithm> #include <vector> #define LL __int64 +; using namespace std; int a[maxn]…
LuckyCycleTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudge/contest/view.action?cid=87326#problem/B Description This problem is about trees. A tree consists of some special points (called nodes), and some lines (called edges)…