Byang's Day Out!

Byang and his little brother Kuno loves Cricket. But they never went to the stadium to watch a match…

Click here to read the complete problem statement.


If you need help solving this problem, mention your approach and ask specific questions. Please avoid sharing your code and asking the Community to figure out “what’s wrong”.

amr (python3)code tiktak vhabe kaj kortese. kintu bar bar 3rd running e (cpu limit exceeded) dekasse. Ami amr code jotota sombob simple reke onk way they try koresi. still same problem… apni ki bolte parben (cpu limit exceeded chara python3 diye solve kora possible kina) kisu hint and tips dile valo hy! TIA

Look at my code :slight_smile:
Source Bruteforce 1.c (393B)

C

#include <stdio.h>
int main ()
{
    int i,a,b,c;
    long long int t ;

    scanf ("%lld",&t);

    for (i=1;i<=t;i++)
    {
        scanf ("%d %d %d",&a,&b,&c);

        if (a>0 && b>0 && c>0 && a<101 && b < 101 && c < 101 ) {

        if (a+b>=c && a+c>=b && b+c>=a)
            printf ("Yes");
        else
            printf ("No");
        }
    }
    return 0 ;

every time my answer is being accepted in the first 2 test cases … But on the 3rd test case , it is showing wrong answer

You need to print a newline character after every test case. The statement says:

print a line saying “Yes” … [or] … “No”.

Your code is printing all of the Yes/No in the same line.

Thanks , brother . I’ve just found out that and solved the problem after 7 unsuccessful attempts … Thanks

1 Like
testNo = int(input())

m = 0	
while m < testNo:
	seq = input().split()
	i = 0
	while i < len(seq):
		seq[i] = int(seq[i])
		i = i+1
	def is_possible():
		j = 0
		k = 1
		l = 2
		while j < len(seq):
			while k < len(seq):
				sum = seq[j] + seq[k]
				k = k+1
				if sum != seq[l] and sum < seq[l]:
					return "No"
			j = j+1


	if is_possible() == "No":
		print(is_possible())
	else:
		print("Yes")
	m = m+1

why is this producing wrong answer on the third case? Please someone help me

Please tell me why my answer is producing WA:
T=int(input())
for i in range(T):
a,b,c=map(int,input().split())
x=a+b
y=b+c
z=a+c
if x>c and y>a and z>b:
print(‘Yes’)
else:
print(‘No’)

just use >= instead of > and replace the line " for i in range(T) " with this line “for i in range(1,T+1)”

1 Like

No worries, I solved it way long ago

1 Like

#include <stdio.h>

int main() {
int a,v,b,c;
scanf(“%d”,&v);
if(v<=1000000){
for(int i=0;i<=v;i++){
scanf(“%d %d %d”,&a,&b,&c);
if(a+b+c<=100){
if(a+b>=c&&a+c>=b&&b+c>=a){
printf(“Yes\n”);
break;
}else {
printf(“No\n”);
break;
}}}
}
return 0;
}what Wring here? It says 3rd case error

New to Golang. Was trying to practice on Toph to get familiar to the language. Can anyone tell me why am I getting CLE for the code below-

[REDACTED]

Thank you

1 Like

It seems the 3rd test case was large enough that Go’s IO functions were not fast enough to consume the entire file in time.

The CPU limit for Go has been adjusted for this problem and your submissions have been rejudged.

Thank you for bringing this to my attention.

1 Like
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,a,b,c;
    cin>>n;
    for(int i=1;i<=n;i++){
        cin>>a>>b>>c;
        if(a>0 && b>0 && c>0 &&a<=100 && b<=100 && c<=100){

        if(a+b>=c){
            cout<<"Yes"<<endl;
        }
        else{
            cout<<"No"<<endl;
        }
        }
    }
}

why I face error on third case?

@Dibbendu.040619 What if their combined height is greater than the wall’s height?

1 Like