█████████ ████ ███░░░░░███ ░░███ ███ ░░░ ██████ ███████ ██████ ██████ ░███ ███░░███ ███░░███ ███░░███ ███░░███ ░███ ░███ ░███░███ ░███ ░███████ ░███ ░███ ░░███ ███░███ ░███░███ ░███ ░███░░░ ░███ ░███ ░░█████████ ░░██████ ░░████████░░██████ ░░██████ ░░░░░░░░░ ░░░░░░ ░░░░░░░░ ░░░░░░ ░░░░░░

Envío 5184

Problema 0xe2 - Detectar overflow al sumar dos enteros de 64 bits

  • Autor: bryancalisto
  • Fecha: 2021-10-25 01:49:15 UTC (Hace alrededor de 3 años)
Caso # Resultado Tiempo Memoria
#1
Correcto
                      main.c:5:33: warning: integer literal is too large to be represented in a signed integer type, interpreting as unsigned [-Wimplicitly-unsigned-literal]
  unsigned long long MAX_UINT = 18446744073709551615;
                                ^
1 warning generated.

                    
0.002 s 0 KBi
#2
Correcto
                      main.c:5:33: warning: integer literal is too large to be represented in a signed integer type, interpreting as unsigned [-Wimplicitly-unsigned-literal]
  unsigned long long MAX_UINT = 18446744073709551615;
                                ^
1 warning generated.

                    
0.005 s 0 KBi
#3
Correcto
                      main.c:5:33: warning: integer literal is too large to be represented in a signed integer type, interpreting as unsigned [-Wimplicitly-unsigned-literal]
  unsigned long long MAX_UINT = 18446744073709551615;
                                ^
1 warning generated.

                    
0.003 s 0 KBi
#4
Correcto
                      main.c:5:33: warning: integer literal is too large to be represented in a signed integer type, interpreting as unsigned [-Wimplicitly-unsigned-literal]
  unsigned long long MAX_UINT = 18446744073709551615;
                                ^
1 warning generated.

                    
0.003 s 0 KBi
#5
Correcto
                      main.c:5:33: warning: integer literal is too large to be represented in a signed integer type, interpreting as unsigned [-Wimplicitly-unsigned-literal]
  unsigned long long MAX_UINT = 18446744073709551615;
                                ^
1 warning generated.

                    
0.004 s 0 KBi
#6
Correcto
                      main.c:5:33: warning: integer literal is too large to be represented in a signed integer type, interpreting as unsigned [-Wimplicitly-unsigned-literal]
  unsigned long long MAX_UINT = 18446744073709551615;
                                ^
1 warning generated.

                    
0.003 s 1 KBi
#7
Correcto
                      main.c:5:33: warning: integer literal is too large to be represented in a signed integer type, interpreting as unsigned [-Wimplicitly-unsigned-literal]
  unsigned long long MAX_UINT = 18446744073709551615;
                                ^
1 warning generated.

                    
0.003 s 0 KBi
#8
Correcto
                      main.c:5:33: warning: integer literal is too large to be represented in a signed integer type, interpreting as unsigned [-Wimplicitly-unsigned-literal]
  unsigned long long MAX_UINT = 18446744073709551615;
                                ^
1 warning generated.

                    
0.003 s 0 KBi
#9
Correcto
                      main.c:5:33: warning: integer literal is too large to be represented in a signed integer type, interpreting as unsigned [-Wimplicitly-unsigned-literal]
  unsigned long long MAX_UINT = 18446744073709551615;
                                ^
1 warning generated.

                    
0.005 s 0 KBi
#10
Correcto
                      main.c:5:33: warning: integer literal is too large to be represented in a signed integer type, interpreting as unsigned [-Wimplicitly-unsigned-literal]
  unsigned long long MAX_UINT = 18446744073709551615;
                                ^
1 warning generated.

                    
0.003 s 0 KBi
#11
Correcto
                      main.c:5:33: warning: integer literal is too large to be represented in a signed integer type, interpreting as unsigned [-Wimplicitly-unsigned-literal]
  unsigned long long MAX_UINT = 18446744073709551615;
                                ^
1 warning generated.

                    
0.003 s 0 KBi
#12
Correcto
                      main.c:5:33: warning: integer literal is too large to be represented in a signed integer type, interpreting as unsigned [-Wimplicitly-unsigned-literal]
  unsigned long long MAX_UINT = 18446744073709551615;
                                ^
1 warning generated.

                    
0.003 s 0 KBi
#13
Correcto
                      main.c:5:33: warning: integer literal is too large to be represented in a signed integer type, interpreting as unsigned [-Wimplicitly-unsigned-literal]
  unsigned long long MAX_UINT = 18446744073709551615;
                                ^
1 warning generated.

                    
0.004 s 0 KBi
#14
Correcto
                      main.c:5:33: warning: integer literal is too large to be represented in a signed integer type, interpreting as unsigned [-Wimplicitly-unsigned-literal]
  unsigned long long MAX_UINT = 18446744073709551615;
                                ^
1 warning generated.

                    
0.003 s 0 KBi
#15
Correcto
                      main.c:5:33: warning: integer literal is too large to be represented in a signed integer type, interpreting as unsigned [-Wimplicitly-unsigned-literal]
  unsigned long long MAX_UINT = 18446744073709551615;
                                ^
1 warning generated.

                    
0.003 s 0 KBi
#16
Correcto
                      main.c:5:33: warning: integer literal is too large to be represented in a signed integer type, interpreting as unsigned [-Wimplicitly-unsigned-literal]
  unsigned long long MAX_UINT = 18446744073709551615;
                                ^
1 warning generated.

                    
0.002 s 1 KBi
#17
Correcto
                      main.c:5:33: warning: integer literal is too large to be represented in a signed integer type, interpreting as unsigned [-Wimplicitly-unsigned-literal]
  unsigned long long MAX_UINT = 18446744073709551615;
                                ^
1 warning generated.

                    
0.003 s 0 KBi
#18
Correcto
                      main.c:5:33: warning: integer literal is too large to be represented in a signed integer type, interpreting as unsigned [-Wimplicitly-unsigned-literal]
  unsigned long long MAX_UINT = 18446744073709551615;
                                ^
1 warning generated.

                    
0.002 s 8 KBi
#19
Correcto
                      main.c:5:33: warning: integer literal is too large to be represented in a signed integer type, interpreting as unsigned [-Wimplicitly-unsigned-literal]
  unsigned long long MAX_UINT = 18446744073709551615;
                                ^
1 warning generated.

                    
0.004 s 0 KBi
#20
Correcto
                      main.c:5:33: warning: integer literal is too large to be represented in a signed integer type, interpreting as unsigned [-Wimplicitly-unsigned-literal]
  unsigned long long MAX_UINT = 18446744073709551615;
                                ^
1 warning generated.

                    
0.003 s 0 KBi
#21
Correcto
                      main.c:5:33: warning: integer literal is too large to be represented in a signed integer type, interpreting as unsigned [-Wimplicitly-unsigned-literal]
  unsigned long long MAX_UINT = 18446744073709551615;
                                ^
1 warning generated.

                    
0.003 s 0 KBi
#22
Correcto
                      main.c:5:33: warning: integer literal is too large to be represented in a signed integer type, interpreting as unsigned [-Wimplicitly-unsigned-literal]
  unsigned long long MAX_UINT = 18446744073709551615;
                                ^
1 warning generated.

                    
0.004 s 1 KBi
#23
Correcto
                      main.c:5:33: warning: integer literal is too large to be represented in a signed integer type, interpreting as unsigned [-Wimplicitly-unsigned-literal]
  unsigned long long MAX_UINT = 18446744073709551615;
                                ^
1 warning generated.

                    
0.003 s 0 KBi
#24
Correcto
                      main.c:5:33: warning: integer literal is too large to be represented in a signed integer type, interpreting as unsigned [-Wimplicitly-unsigned-literal]
  unsigned long long MAX_UINT = 18446744073709551615;
                                ^
1 warning generated.

                    
0.003 s 0 KBi
#25
Correcto
                      main.c:5:33: warning: integer literal is too large to be represented in a signed integer type, interpreting as unsigned [-Wimplicitly-unsigned-literal]
  unsigned long long MAX_UINT = 18446744073709551615;
                                ^
1 warning generated.

                    
0.003 s 0 KBi
#26
Correcto
                      main.c:5:33: warning: integer literal is too large to be represented in a signed integer type, interpreting as unsigned [-Wimplicitly-unsigned-literal]
  unsigned long long MAX_UINT = 18446744073709551615;
                                ^
1 warning generated.

                    
0.003 s 0 KBi
#27
Correcto
                      main.c:5:33: warning: integer literal is too large to be represented in a signed integer type, interpreting as unsigned [-Wimplicitly-unsigned-literal]
  unsigned long long MAX_UINT = 18446744073709551615;
                                ^
1 warning generated.

                    
0.003 s 0 KBi
#28
Correcto
                      main.c:5:33: warning: integer literal is too large to be represented in a signed integer type, interpreting as unsigned [-Wimplicitly-unsigned-literal]
  unsigned long long MAX_UINT = 18446744073709551615;
                                ^
1 warning generated.

                    
0.002 s 0 KBi
#29
Correcto
                      main.c:5:33: warning: integer literal is too large to be represented in a signed integer type, interpreting as unsigned [-Wimplicitly-unsigned-literal]
  unsigned long long MAX_UINT = 18446744073709551615;
                                ^
1 warning generated.

                    
0.002 s 1 KBi
Puntos totales: 100 / 100

Código

#include <stdio.h>

int main()
{
  unsigned long long MAX_UINT = 18446744073709551615;
  unsigned long long num1;
  unsigned long long num2;

  scanf("%llu", &num1);
  scanf("%llu", &num2);

  if (num1 <= MAX_UINT - num2)
  {
    printf("Safe");
  }
  else
  {
    printf("Overflow");
  }

  return 0;
}