Byang's Day Out!

Limits: 5s, 512 MB

Byang and his little brother Kuno loves Cricket. But they never went to the stadium to watch a match live, happening in front of them! So now is their time to watch a game from the Eastern Stand of Mirpur Sher-E-Bangla Stadium. They have spent 18 hours in the queue (yes, 18 hours) to manage two tickets. But there’s a little problem, and we jump right in to help them.

This is a companion discussion topic for the original entry at

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)


#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");
            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":
	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:
for i in range(T):
if x>c and y>a and z>b:

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;
for(int i=0;i<=v;i++){
scanf("%d %d %d",&a,&b,&c);
}else {
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-


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