You are not logged in. Please login at www.codechef.com to post your questions!

×

What's wrong in this code for CNOTE?

#include <iostream>
#include <bits/stdc++.h>

#define fast  ios_base::sync_with_stdio(false); cin.tie(NULL)
#define ll long long

using namespace std;

int main() {
    fast;
    ll T;
    cin >> T;
    while (T--) {
        ll X, Y, N, K;
        cin >> X >> Y >> N >> K;
        bool found = false;
        for (ll i = 0; i < N; i++) {
            ll Pi, Ci;
            cin >> Pi >> Ci;
            if (Pi >= X - Y && Ci <= K)
                found = true;
        }
        cout << (found ? "LuckyChef" : "UnluckyChef") << '\n';
    }
    return 0;
}

asked 15 Apr, 10:18

arnavvarshney's gravatar image

3★arnavvarshney
646
accept rate: 20%


you took the input in wrong format cin>>X>>Y>>K>>N; is the right way

link

answered 15 Apr, 11:11

ram_24's gravatar image

4★ram_24
351
accept rate: 33%

Could you upvote it :)

(15 Apr, 11:12) ram_244★
toggle preview
Preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:

×12

question asked: 15 Apr, 10:18

question was seen: 59 times

last updated: 15 Apr, 11:12