Iam getting tle THIS IS JAN COOKOFF CONTEST PROBLUM DIV3 .PROB. NAME IS PASSWORD

#include

#include

using namespace std;

#define int long

signed main() {

int t;

cin>>t;

char ch;

ch=cin.get();

while(t–){

string x;

getline(cin,x);

//cout<<x<<" ";

if(x.length()<10){

cout<<"NO"<<endl;

}

else{

int cn_1=0,cn_2=0,cn_3=0,cn_4=0;

for(int i=0;i<x.length();i++){

if(cn_1>=1&&cn_2>=1&&cn_3>=1&&cn_4>=1){

break;

}

if(x[i]>=97&&x[i]<=122){

cn_1++;

}

if(i>=1&&i<x.length()-1){

if(x[i]>=65&&x[i]<=90){

cn_2++;

}

if(x[i]>=48&&x[i]<=57){

//cout<<x[i];

cn_3++;

}

if(x[i]==’@’||x[i]==’#’||x[i]==’%’||x[i]==’&’||x[i]==’?’){

cn_4++;

}

}

}

//cout<<cn_1<<" β€œ<<cn_2<<” β€œ<<cn_3<<” "<<cn_4<<endl;

if(cn_1>=1&&cn_2>=1&&cn_3>=1&&cn_4>=1){

cout<<"YES"<<endl;

}

else{

cout<<"NO"<<endl;

}

//cout<<cn_1<<" β€œ<<cn_2<<” "<<cn_3<<endl;

}

}

return 0;

}

because you are doing while(t-) but it should be while(t- -) two minus sign and you are not including anything like you should do #include<bits/stdc++.h>

No, he might have actually included them, but they aren’t visible because he pasted his raw code.
He should format his code.
@aman2512 paste your code in between a pair of 3 back ticks (```).
Example:

#include <stdio.h>
int main() {
    printf("Hello, World!");
    return 0;
}

Secondly, I would also suggest @aman2512 to share the link to his submission instead of pasting code. It would be easier.

2 Likes