Question no 3 starters 127 division 4

it is giving wrong answer in last testcase and cant see the testcase bcs of pro version so can you help me with thhis what might be the reason of wrong answer
include
using namespace std;

int main() {
int T;
cin >> T;

while (T--) {
    int N, K, X;
    cin >> N >> K >> X;
    
    // Calculate the sum of the first K elements of a superincreasing array
    long long C = (1LL << (K - 1)); // 2^(K-1)
    
    // Check if X is greater than or equal to C
    if(X >= C) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
}

return 0;

}

when you give long long c = (1LL << (k - 1)); it uses a ferict so use pow() to rectify this error.

1 Like