TopCoder SRM 588 DIV2 KeyDungeonDiv2

OpenSoucre發表於2013-08-14

簡單的題目

class KeyDungeonDiv2
{
public:
    int countDoors(vector <int> doorR, vector <int> doorG, vector <int> keys)
    {
        int res = 0;
        for(int i = 0 ; i < doorR.size(); i ++){
            if(doorR[i]  <= keys[0]+keys[2] && doorG[i] <= keys[1]+keys[2] && doorR[i] + doorG[i] <=keys[0]+keys[1]+keys[2]) res ++;
        }
        return res;
    }
};

 

相關文章