Category Archives: BEECROWD

BeeCrowd Solution: Unleashing the Power of Collective Intelligence

Revolutionize your strategies with BeeCrowd Solution – harnessing collective intellect for unprecedented innovation and growth. Join now!

Beecrowd 1040 Average 3 Solution in C, C++, Python

Question

Beecrowd 1040 Average 3 Solution in C,C++,Python

#include <stdio.h>
int main()
{
    float a, b, c, d, e, i, j, k;
    double avg, avrg;
    scanf("%f %f %f %f", &a, &b, &c, &d);
    avg = ((a*2) + (b*3) + (c*4) + d) / 10;
    printf("Media: %.1lf\n", avg);
    if ( avg < 5.0 ){
        printf("Aluno reprovado.\n");
    }
    else if( avg >= 7.0 ){
        printf("Aluno aprovado.\n");
    }
    else{
        printf("Aluno em exame.\n");//Beecrowd  1040 Average 3 Solution
        scanf("%f",&e);
        printf("Nota do exame: %.1f\n",e);
        avrg = (avg+e) / 2;
        if ( avrg >= 5.0 ){
            printf("Aluno aprovado.\n");
        }
        else {printf ("Aluno reprovado.\n");
        }
        printf("Media final: %.1lf\n",avrg);
    }
    return 0;
}

Next Problem: Beecrowd 1045 solution in C,C++,Python

Beecrowd 1045 Triangle Types solution in C, C++, Python

Beecrowd 1045 Triangle Types solution

Question

BEE 1045 – Triangle Types Solution in C

BEE 1045 – Triangle Types Solution in C++

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


int main() {
    double a, b, c, temp, i, j;
    cin >> a >> b >> c;

    if (a < b) {
        temp = a;
        a = b;
        b = temp;
    }
    if (a < c) {
        temp = a;
        a = c;//Beecrowd 1045 Triangle Types solution 
        c = temp;
    }
    if (b < c) {
        temp = b;
        b = c;
        c = temp;
    }

    i = b * b + c * c;
    j = a * a;

    if (a >= b + c) {
cout << "NAO FORMA TRIANGULO" <<endl;
    } else {
        if (j == i) {
cout << "TRIANGULO RETANGULO" << endl;
        }
        if (j > i) {
cout << "TRIANGULO OBTUSANGULO" << endl;
        }
        if (j < i) {
cout << "TRIANGULO ACUTANGULO" <<endl;
        }
        if (a == b && b == c) {
cout << "TRIANGULO EQUILATERO" <<endl;
        } else if (a == b || b == c || c == a) {
cout << "TRIANGULO ISOSCELES" <<endl;
        }
    }

    return 0;
}

BEE 1045 – Triangle Types Solution in Python

def main():
    a, b, c = map(float, input().split())
    temp = 0
    i = 0
    j = 0

    if a < b:
        temp = a
        a = b
        b = temp
    if a < c:
        temp = a
        a = c
        c = temp
    if b < c:
        temp = b
        b = c
        c = temp

    i = b * b + c * c
    j = a * a

    if a >= b + c:
        print("NAO FORMA TRIANGULO")
    else:
        if j == i:
            print("TRIANGULO RETANGULO")
        if j > i:
            print("TRIANGULO OBTUSANGULO")
        if j < i:
            print("TRIANGULO ACUTANGULO")
        if a == b and b == c:
            print("TRIANGULO EQUILATERO")
        elif a == b or b == c or c == a:
            print("TRIANGULO ISOSCELES")

if __name__ == "__main__":
    main()

Next problem: Beecrowd 1046 solution || URI – BEECROWD – BEE Online Judge Solution  1046-Game Time

Beecrowd 1046 solution || URI – BEECROWD – BEE Online Judge Solution  1046-Game Time || Uri 1046 solution in C, C++

submit link

Beecrowd 1046 solution || URI – BEECROWD – BEE 1046 Solution in C, C++

Question

Game Time

Read the start time and end time of a game, in hours. Then calculate the duration of the game, knowing that the game can begin in a day and finish in another day, with a maximum duration of 24 hours. The message must be printed in portuguese “O JOGO DUROU X HORA(S)” that means “THE GAME LASTED X HOUR(S)”

Input

Two integer numbers representing the start and end time of a game.

Output

Print the duration of the game as in the sample output.Beecrowd 1046

Input SampleOutput Sample
16 2O JOGO DUROU 10 HORA(S)
0 0O JOGO DUROU 24 HORA(S)
2 16O JOGO DUROU 14 HORA(S)

Beecrowd/Uri 1046 solution in C

#include <stdio.h>

int main() {

   int a,b;
   scanf("%d%d",&a,&b);
  if(a==b){
      printf("O JOGO DUROU 24 HORA(S)\n");
  }
  if(b>a){
      printf("O JOGO DUROU %d HORA(S)\n",b-a);
  }
  if(a>b){
      printf("O JOGO DUROU %d HORA(S)\n",(b+24)-a);//Beecrowd 1046 solution
  }
    return 0;
}

Beecrowd/Uri 1046 solution in C++

#include <iostream>
using namespace std;

int main() {
    int a, b;
    std::cin >> a >> b;

    if (a == b) {
   cout << "O JOGO DUROU 24 HORA(S)" <<endl;
    } else if (b > a) {
      cout << "O JOGO DUROU " << b - a << " HORA(S)" <<endl;
    } else {
       cout << "O JOGO DUROU " << (b + 24) - a << " HORA(S)" <<endl;
    }

    return 0;
}

Previous Post: Beecrowd 1044 solution || Beecrowd 1044 Multiples Solution in C & C++

Beecrowd 1020 Solution in C, C++ & Python

URI – BEECROWD – BEE Online Judge || Age In Days – URI – BEE 1020 Solution in C,C++, Python

Question

#include <stdio.h>

int main() {

   int d,y,m;
   scanf("%d",&d);
   y=0;
   m=0;
   y=d/365;
   d=d%365;
   m=d/30;
   d=d%30;
   printf("%d ano(s)\n%d mes(es)\n%d dia(s)\n",y,m,d);
    return 0;
}

Bee1020 Solution in C++

#include <iostream>
using namespace std;

int main() {
    int d, y, m;
   cin >> d;
    y = 0;
    m = 0;
    y = d / 365;
    d = d % 365;
    m = d / 30;
    d = d % 30;
    cout << y << " ano(s)\n" << m << " mes(es)\n" << d << " dia(s)\n";
    return 0;
}

Bee1020 Solution in Python

d = int(input())
y = 0
m = 0
y = d // 365
d = d % 365
m = d // 30
d = d % 30
print(f"{y} ano(s)\n{m} mes(es)\n{d} dia(s)")

Beecrowd 1019 solution || URI – BEECROWD – BEE 1019 Time Conversion Solutions in C, C++, and Python

Beecrowd 1019 solution || URI – BEECROWD – BEE 1019 Time Conversion Solutions in C, C++, and Python – Comprehensive Guide

URI – BEECROWD – BEE 1019 Time Conversion Solutions in C, C++, and Python || Beecrowd 1019 solution

Question

Understand the challenge: Beecrowd 1019 solution


Beecrowd 1019 solution presents the classic scheduling challenge: time shifting. In the challenge, times in seconds are converted to hours, minutes and seconds. This seemingly simple task requires a deep understanding of time distribution and variables. Our team of experts cracked the challenge and developed a comprehensive solution that not only solves the problem but also provides insight into the underlying concepts.

The essence of the time change


Time is a universal constant, but its representation varies from situation to situation. In programming, time is usually represented in seconds, and should be converted to a more human-readable format. This is where seasonal change becomes inevitable. Time conversion efficiency enables programmers to create applications that display time in a user-friendly manner, synchronize events, and perform robust calculations based on time intervals

Building the Solution: C, C++, Python Style


Our experts carefully developed a solution for URI Online Judge 1019 using three popular programming languages: C, C++ and Python. The solution not only provides a successful conversion but also demonstrates the versatility of these languages. Let’s take a closer look at each function:

URI – BEECROWD – BEE 1019 Time Conversion Solutions in C, C++, and Python ||Beecrowd 1019 solution

URI Online Judge 1019 Solve  in C : 
#include <stdio.h>

int main() {

int h,m,s;
scanf("%d",&s);
h=0;
m=0;
h=s/3600;
s=s%3600;
m=s/60;
s=s%60;
printf("%d:%d:%d\n",h,m,s);//Beecrowd 1019 solution
    return 0;
}

INPUT: 556

OUTPUT: 0:9:16

URI Online Judge 1019 Solve  in C++ : 

#include<iostream>
using namespace std;

int main() {

int h,m,s;
cin>>s;
h=0;
m=0;
h=s/3600;
s=s%3600;
m=s/60;
s=s%60;
cout<<":"<<h<<":"<<m<<":"<<s<<endl;

    return 0;
}

INPUT: 556

OUTPUT: 0:9:16

URI Online Judge 1019 Solve  in Python : 

total_seconds = int(input())

hours = total_seconds // 3600
minutes = (total_seconds % 3600) // 60
seconds = total_seconds % 60

print(f"{hours}:{minutes}:{seconds}")

INPUT: 556

OUTPUT: 0:9:16

Conclusion

One crucial ability that cuts across language borders is time management. When this ability is honed, programmers can produce effective, user-friendly apps that faithfully depict the past. Our thorough guide offers complete solutions in C, C++, and Python for the URI Online Judge 1019 problem. For your benefit, we have also examined cutting-edge subjects and offered examples. You are equipped with this manual to tackle time-varying issues and hone your organizing abilities.

Start learning to program today with [Free Code Center]. Coding is fun!

Uri 1080 Solution || BEE 1080 || Beecrowd1080 Highest and Position

Uri 1080 Solution || BEE 1080 || Beecrowd1080 Highest and Position

Beecrowd1080 Highest and Position question

Uri 1080 Solution || BEE 1080 ||Free Code Center

Highest and Position

Adapted by Neilor Tonin, URI  Brazil

Timelimit: 1

Read 100 integer numbers. Print the highest read value and the input position.

Input

The input file contains 100 distinct positive integer numbers.

Output

Print the highest number read and the input position of this value, according to the given example.

Input SampleOutput Sample
2
113
45
34565
6

8
 
34565
4
URI / BEECROWD Online Judge 1080 Solve  in C :  
#include <stdio.h>
 
int main() {
 
   int a,i,l=0,p=0;
   for(i=1;i<=100;i++){
       scanf("%d",&a);
       if(a>l){
         l=a; 
        p=i; 
       }
   }
   printf("%d\n",l);
   printf("%d\n",p);
 
    return 0;
}
URI / BEECROWD Online Judge 1080 Solve  in C++:  
#include <bits/stdc++.h>
using namespace std;
 
int main() {
 
   int a,i,l=0,p=0;
   for(i=1;i<=100;i++){
   cin>>a;
       if(a>l){
         l=a; 
        p=i; 
       }
   }
cout<<l<<endl;
cout<<p<<endl;
    return 0;
}

Previous Problem: Beecrowd 1178 Array Fill III Solution

BEECROWD 1074 Even or Odd Solution in C,C++,Python || Free Code Center

BEECROWD 1074 Even or Odd Solution in C,C++,Python

BEECROWD 1074 Even or Odd question

Welcome to our comprehensive guide on how to solve the “BEE CROWD 1074 Even or Odd ” problem using C++, C and Python. In this article, we will explain the solution to the Even Square problem, how to write code in C++, C and Python, and how to optimize the code for maximum performance.

Problem Description

The Even Square problem requires us to find the sum of the squares of even numbers between two given numbers, inclusive. For example, given the input range [2,10], the program should output 220, which is the sum of the squares of the even numbers between 2 and 10 (i.e., 2^2 + 4^2 + 6^2 + 8^2 + 10^2).

Solving the Problem in C++

C++ is a popular language used for competitive programming and algorithmic problem-solving. Solving the Even Square problem in C++ involves iterating over the given range of numbers, checking if the current number is even, squaring the number if it is even, and adding it to a running total. Here’s the C++ code to solve the Even Square problem:

#include <iostream>

using namespace std;

int main() {

  int a,n;
  cin>>n;
  for(int i=0;i<n;i++)
  {
      cin>>a;
      if(a>0)
      {
          if(a%2==0)
          cout<<"EVEN POSITIVE"<<endl;
           else
           cout<<"ODD POSITIVE"<<endl;
      }
      else if(a<0)
      {
          if(a%2==0)
          cout<<"EVEN NEGATIVE"<<endl;

          else
          cout<<"ODD NEGATIVE"<<endl;
      }
      else
      cout<<"NULL"<<endl;
  }

    return 0;
}

Solving the Problem in C

C is another popular language used for competitive programming and algorithmic problem-solving. The Even Square problem can be solved in C using the same logic as in C++. Here’s the C code to solve the Even Square problem:

#include <stdio.h>

int main()
{
    int a, b, sum = 0;
    scanf("%d %d", &a, &b);
    for(int i = a; i <= b; i++)
    {
        if(i % 2 == 0)
        {
            sum += i * i;
        }
    }
    printf("%d\n", sum);
    return 0;
}

Solving the Problem in Python

Python is a popular language used for data science, machine learning, and algorithmic problem-solving. The Even Square problem can also be solved in Python using a similar loop-based approach. Here’s the Python code to solve the Even Square problem:

a, b = map(int, input().split())
sum = 0
for i in range(a, b + 1):
    if i % 2 == 0:
        sum += i * i
print(sum)

Performance Optimization

While the above code solutions are straightforward, there are a few tips and tricks that can be used to optimize the performance of the code. Here are some ways to optimize the code:

Using bitwise operations instead of modulo operator

Instead of using the modulo operator to check if a number is even, we can use bitwise operations. For example, to check if a number is even, we can use the following code: if((i & 1) == 0).

previous problem: Beecrowd 1026 To Carry or not to Carry Solution

BEECROWD 1074

Beecrowd 1026 To Carry or Not to Carry Solution || Beecrowd 1026 Solution|| Free Code Center

Beecrowd 1026 To Carry or not to Carry Solution in C++

Introduction

URI/Beecrowd Online Judge is a platform that provides programming challenges and exercises to individuals who are interested in sharpening their programming skills. It is an excellent tool for anyone who wants to learn how to code, and the challenges are designed to be both challenging and engaging.

URI Beecrowd 1026 To Carry or Not to Carry Solution is one such programming challenge that is often attempted by C/C++ programmers. It involves bitwise operations, and the goal is to convert two integers to their binary form and then perform a bitwise XOR operation on them.

Problem Statement The problem statement for URI Beecrowd 1026 To Carry or not to Carry Solution is as follows:

“Read two integers and calculate the bitwise XOR between them. Then, convert this result to a decimal value.”

Solution in C++

#include <iostream>
using namespace std;

int main(){
 unsigned long int x, y, r;

 while(cin >> x >> y) {
      r = x ^ y;
     cout << r << endl;
 }

 return 0;
}

URI Beecrowd 1116 Dividing X by Y Solution

C Programming Basics Problems for Beginners

URI Beecrowd 1116 Dividing X by Y Solution

URI Beecrowd 1116 Dividing X by Y Solution

URI BEECROWD Problems Solution

In this article, we will be discussing the solution to a coding problem that involves dividing X by Y. We will be using the programming languages C, C++, and Python to provide you with a solution that is not only accurate but also easy to understand.

The problem we will be solving is called the Uri Beecrowd 1116 – Dividing X by Y” problem. The objective of this problem is to divide two integers X and Y and output the quotient and remainder of the division. This problem can be solved using the modulus operator and integer division.

To start, we will first provide a brief overview of the problem statement and the input and output format. This will ensure that you have a clear understanding of the problem before we dive into the solution.

Problem Statement

Given two integers X and Y, you have to find the quotient and remainder of the division of X by Y.

Input Format

The input consists of two integers X and Y, where X is the dividend, and Y is the divisor.

Output Format

The output consists of two integers, the quotient, and the remainder of the division of X by Y.

Now that we have a clear understanding of the problem, let’s dive into the solution.

Solution

To solve this problem, we will use the modulus operator and integer division. The modulus operator gives us the remainder of the division, while integer division gives us the quotient.

C++ Solution

#include <iostream>

using namespace std;

int main() {
 int a;
 cin>>a;
 double d,b,c;
 for(int i=0;i<a;i++)
 {
    cin>>b>>c;
    d=b/c;
    if(c==0) {
            cout<<"divisao impossivel"<<endl;
    }
    else
    {
printf("%.1f\n",d);
    }

 }


    return 0;
}


Conclusion

In this article, we discussed the solution to the Uri Beecrowd 1116 – Dividing X by Y problem using the programming language C++. We provided a clear and concise explanation of the problem, the input and output format, and the solution using

Previous problem:Beecrowd 1049 Animal Solution

Beecrowd 1049 Animal Solution

Beecrowd 1049 Animal Solution

Animal

Introduction

In this guide, we will be discussing the Beecrowd 1049 Animal problem and providing a detailed solution in C, C++, C++, and Python. Our goal is to help readers understand the problem, provide a clear and concise solution, and offer tips on how to improve their programming skills.

URI(Beecrowd ) 1049 Animal Problem

The Beecrowd 1049 Animal problem is a popular programming problem that requires programmers to write a program that accepts three strings as input and outputs a specific animal based on the input. The first input string represents the animal’s class, the second input string represents the animal’s order, and the third input string represents the animal’s species.

Solution in CPP

#include<iostream>
#include<string>
using namespace std;
int main()
{
    string a,b,c;
    getline(cin,a);
    getline(cin,b);
    getline(cin,c);

    if(a=="vertebrado")
    {
        if(b=="ave")
        {
            if(c=="carnivoro")
                cout<<"aguia"<<endl;
            else
            {
                cout<<"pomba"<<endl;
            }
        }
        else if(b=="mamifero") {
            if(c=="onivoro")
        {
            cout<<"homem"<<endl;
        }
        else
        {
            cout<<"vaca"<<endl;
        }
        }
    }
    else if(a=="invertebrado") {
        if(b=="anelideo")
Beecrowd 1049 Animal Solution

Previous problem:URI Bee Crowd 1095: How to Solve the Sequence IJ-1 Problem