 # LOSTWKND - Editorial

There is difference in “YES” and “Yes” and same for NO and No

yes because output is case sensitive and codechef will give WA for YES and NO in this question as i have already mentioned above

class Codechef
{
public static void main (String[] args) throws java.lang.Exception
{
Scanner sc = new Scanner(System.in);
int tcs = sc.nextInt();
while(tcs > 0) {
int sum = 0;
for(int i = 0; i<5; i++){
sum = sum + sc.nextInt();
}
int p = sc.nextInt();
if((sum * p) <= 120) {
System.out.println(“Yes”);
} else {
System.out.println(“No”);
}
tcs–;
}

``````}
``````

}

Getting WA for this piece. Can someone point out?

1 Like

## Hi A=A1 A=A2 A=A3 A=A4 A=A5 sum=0 sum=sum+A+A+A+A+A mix=P*sum if mix>125 print yes else print no

I hope its clear and useful

it should be mix > 120, not 125. I’m guessing it’s a typo

Yes, You are right its 5 * 24 = 120
but
what is typo?

1 Like

Typo is slang for typing error

``````#include<bits/stdc++.h>
using namespace std;
int main(){
int t,p;
cin>>t;
while(t--){
vector<int> a(5);
for(auto &it: a) cin>>it;
cin>>p;
for(int i=0;i<(int)a.size();i++){
a[i]=a[i]*p;
}
int x=accumulate(a.begin(),a.end(),0);

if(x>120)
cout<<"Yes\n";
else
cout<<"No\n";
}
return 0;
}
``````

Why the above code shows Runtime Error(SIGCONT)?
Frustrating!
Its running just fine on my machine as well as geeksforgeeks IDE…I think something is wrong with CodeChef IDE !

#include <bits/stdc++.h>
using namespace std;

int main(){
int x,a,c,y;
cin>>x;
while(x!=0) {c=0;
for(int i=0;i<5;i++){
cin>>a[i];}
cin>>y;
for(int i=0;i<5;i++){
c=c+a[i]*y;}
if(c<=120)
{ cout<<“No\n”;}
else
{ cout<<“Yes\n”;}
x–;
}
return 0;
}

``````#include <bits/stdc++.h>
using namespace std;

int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int t,s=0;
cin>>t;
while(t--)
{
int a,p;
for(int i =0 ;i<5;i++)
{
cin>>a[i];
s+=a[i];
}
cin>>p;
if(s*p>120)
{
cout<<"Yes"<<"\n";
}
else
{
cout<<"No"<<"\n";
}
}
return 0;
}
``````

What’s wrong here can’t figure out?
@galencolin @hackslash_123 @taran_1407

If you’re going to ping me, at least format your code

1 Like

Oh my bad I am new to all of this. Getting use to it.

Good, now you know how the sample has two testcases? Reverse their order and run your program on it.

1 Like

I have to reset “s”. I wasn’t doing that.

Thanks for helping out !

1 Like

I am new to Competitive Programming. Not getting proper guidance. If you could guide me regarding it.

It would be great help How so? I feel like I could form some public “guidance” group where I spam my “tutorial” blogs and force people to heart them Generally though, I would recommend not having guidance, at least to some extent. The more questions you ask, the less you figure out for yourself, and the less you’ll be able to remember or use the information in the future. Unfortunately most people on here don’t seem to realize that. I’ll give you an EXCLUSIVE CP TRAINING CLICKBAIT TIP though - this site got me started with CP and it’s awesome.

1 Like

Thanks !