FANCY - EDITORIAL

Thats even more scary :frowning:

Even discuss got scared by your editorial~~~

I hope everyone knows the context :p

Setterโ€™s solution

1 Like

ACed Solution: CodeChef: Practical coding for everyone
You should print exactly as specified

I could not find your submission but here is my submission i made using above mentioned code.
I think you might be trying on codechef ide and not giving any custom input and NZEC is due to no data in stdin.

Sorry, the issue came up because I used cin.ignore() in a loop. I will be careful before posting next time.

I hope this will Help You alot :
Just Go Through this

And Subscribe my channel Hello World Please.

why did you use getline(cin,s) before starting the while testcase loop?

https://www.codechef.com/viewsolution/33964025
can someone tell me why my solution is wrong ?It satisfies the test cases but

For the same reason you are using cin.ignore.

Well you should consider reading the editorial before asking doubts.

It because we need to ignore the โ€œ\nโ€ after reading โ€œtโ€.
If we donโ€™t do it then the first input string will be an empty string.

Can someone tell me why am I getting the error? Passes all TC with 80ms on my local IDE

for _ in range(int(input())):
    strin = input()
    print ('Real Fancy') if len(strin) <= 100 and strin.find('not ') != -1 else print('regularly fancy')

Here is my solution:

I used cin.ignore() according to this topic c++ - getline() does not work if used after some inputs - Stack Overflow
and converted input to string, then checked by chars not by words.

#include <bits/stdc++.h>
#define ll long long
#define llinf LLONG_MAX
#define llminf LLONG_MIN
#define inf INT_MAX
#define minf INT_MIN
unsigned long int M = 1000000007;

using namespace std;

int main() {
	int t;
	cin >> t;
	cin.ignore();
	while (t--) {
	    string s;
	    getline(cin,s);
	    if (s.length()==3) {
	        if (s[0]=='n' and s[1]=='o' and s[2]=='t') {
	            cout << "Real Fancy" << endl;
	            continue;
	        }
	    }
	    else if (s.length()>3) {
	        if (s[0]=='n' and s[1]=='o' and s[2]=='t' and s[3]==' ') {
	            cout << "Real Fancy" << endl;
	            continue;
	        }
	        else if (s[s.length()-1]=='t' and s[s.length()-2]=='o' and s[s.length()-3]=='n' and s[s.length()-4]==' ') {
	            cout << "Real Fancy" << endl;
	            continue;
	        }
	    }
	    if (s.find(" not ")!=string::npos) {
	        cout << "Real Fancy" << endl;
	    }
	    else {
	        cout << "regularly fancy" << endl;
	    }
	}
	return 0;
}