Codechef Problems: Assignment Due (P1_175)

 Problem Statement: 


Solution: 

Given, 
    X : Number of Days required to Complete the Assignment 
    Y : Number of Days till Assignment Deadline 

To find: Whether the Assignment will be Completed before Deadline 

Condition 1 : If X <= Y  
    i.e., number of days required to complete the assignment will be less than or equals to number of days till assignment deadline 

this means assignment can be completed before deadline so answer will be "YES" 

Condition 2: Else or X > Y 
    i.e., number of days required to complete the assignment will be greater than the number of days till assignment deadline 

this means assignment can not be completed before deadline so answer will be "NO" 

Code Solution: 

#include <bits/stdc++.h>

using namespace std;

int main() {
    int x, y;
    cin >> x >> y;

    if (x <= y) {
        cout << "YES" << endl;
    } else {
        cout << "NO" << endl;
    }
}

Comments