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

Envío 5183

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

  • Autor: bryancalisto
  • Fecha: 2021-10-25 01:48:27 UTC (Hace más de 2 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;
                                ^
main.c:9:15: warning: format specifies type 'int *' but the argument has type 'unsigned long long *' [-Wformat]
  scanf("%d", &num1);
         ~~   ^~~~~
         %lld
main.c:10:15: warning: format specifies type 'int *' but the argument has type 'unsigned long long *' [-Wformat]
  scanf("%d", &num2);
         ~~   ^~~~~
         %lld
3 warnings generated.

                    
0.003 s 0 KBi
#2
Incorrecto
                      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;
                                ^
main.c:9:15: warning: format specifies type 'int *' but the argument has type 'unsigned long long *' [-Wformat]
  scanf("%d", &num1);
         ~~   ^~~~~
         %lld
main.c:10:15: warning: format specifies type 'int *' but the argument has type 'unsigned long long *' [-Wformat]
  scanf("%d", &num2);
         ~~   ^~~~~
         %lld
3 warnings generated.

                    
0.003 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;
                                ^
main.c:9:15: warning: format specifies type 'int *' but the argument has type 'unsigned long long *' [-Wformat]
  scanf("%d", &num1);
         ~~   ^~~~~
         %lld
main.c:10:15: warning: format specifies type 'int *' but the argument has type 'unsigned long long *' [-Wformat]
  scanf("%d", &num2);
         ~~   ^~~~~
         %lld
3 warnings 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;
                                ^
main.c:9:15: warning: format specifies type 'int *' but the argument has type 'unsigned long long *' [-Wformat]
  scanf("%d", &num1);
         ~~   ^~~~~
         %lld
main.c:10:15: warning: format specifies type 'int *' but the argument has type 'unsigned long long *' [-Wformat]
  scanf("%d", &num2);
         ~~   ^~~~~
         %lld
3 warnings generated.

                    
0.003 s 0 KBi
#5
Incorrecto
                      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;
                                ^
main.c:9:15: warning: format specifies type 'int *' but the argument has type 'unsigned long long *' [-Wformat]
  scanf("%d", &num1);
         ~~   ^~~~~
         %lld
main.c:10:15: warning: format specifies type 'int *' but the argument has type 'unsigned long long *' [-Wformat]
  scanf("%d", &num2);
         ~~   ^~~~~
         %lld
3 warnings generated.

                    
0.002 s 3 KBi
#6
Incorrecto
                      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;
                                ^
main.c:9:15: warning: format specifies type 'int *' but the argument has type 'unsigned long long *' [-Wformat]
  scanf("%d", &num1);
         ~~   ^~~~~
         %lld
main.c:10:15: warning: format specifies type 'int *' but the argument has type 'unsigned long long *' [-Wformat]
  scanf("%d", &num2);
         ~~   ^~~~~
         %lld
3 warnings generated.

                    
0.002 s 14 KBi
#7
Incorrecto
                      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;
                                ^
main.c:9:15: warning: format specifies type 'int *' but the argument has type 'unsigned long long *' [-Wformat]
  scanf("%d", &num1);
         ~~   ^~~~~
         %lld
main.c:10:15: warning: format specifies type 'int *' but the argument has type 'unsigned long long *' [-Wformat]
  scanf("%d", &num2);
         ~~   ^~~~~
         %lld
3 warnings generated.

                    
0.002 s 0 KBi
#8
Incorrecto
                      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;
                                ^
main.c:9:15: warning: format specifies type 'int *' but the argument has type 'unsigned long long *' [-Wformat]
  scanf("%d", &num1);
         ~~   ^~~~~
         %lld
main.c:10:15: warning: format specifies type 'int *' but the argument has type 'unsigned long long *' [-Wformat]
  scanf("%d", &num2);
         ~~   ^~~~~
         %lld
3 warnings generated.

                    
0.003 s 0 KBi
#9
Incorrecto
                      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;
                                ^
main.c:9:15: warning: format specifies type 'int *' but the argument has type 'unsigned long long *' [-Wformat]
  scanf("%d", &num1);
         ~~   ^~~~~
         %lld
main.c:10:15: warning: format specifies type 'int *' but the argument has type 'unsigned long long *' [-Wformat]
  scanf("%d", &num2);
         ~~   ^~~~~
         %lld
3 warnings generated.

                    
0.003 s 3 KBi
#10
Incorrecto
                      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;
                                ^
main.c:9:15: warning: format specifies type 'int *' but the argument has type 'unsigned long long *' [-Wformat]
  scanf("%d", &num1);
         ~~   ^~~~~
         %lld
main.c:10:15: warning: format specifies type 'int *' but the argument has type 'unsigned long long *' [-Wformat]
  scanf("%d", &num2);
         ~~   ^~~~~
         %lld
3 warnings generated.

                    
0.004 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;
                                ^
main.c:9:15: warning: format specifies type 'int *' but the argument has type 'unsigned long long *' [-Wformat]
  scanf("%d", &num1);
         ~~   ^~~~~
         %lld
main.c:10:15: warning: format specifies type 'int *' but the argument has type 'unsigned long long *' [-Wformat]
  scanf("%d", &num2);
         ~~   ^~~~~
         %lld
3 warnings generated.

                    
0.004 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;
                                ^
main.c:9:15: warning: format specifies type 'int *' but the argument has type 'unsigned long long *' [-Wformat]
  scanf("%d", &num1);
         ~~   ^~~~~
         %lld
main.c:10:15: warning: format specifies type 'int *' but the argument has type 'unsigned long long *' [-Wformat]
  scanf("%d", &num2);
         ~~   ^~~~~
         %lld
3 warnings generated.

                    
0.002 s 0 KBi
#13
Incorrecto
                      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;
                                ^
main.c:9:15: warning: format specifies type 'int *' but the argument has type 'unsigned long long *' [-Wformat]
  scanf("%d", &num1);
         ~~   ^~~~~
         %lld
main.c:10:15: warning: format specifies type 'int *' but the argument has type 'unsigned long long *' [-Wformat]
  scanf("%d", &num2);
         ~~   ^~~~~
         %lld
3 warnings generated.

                    
0.003 s 1 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;
                                ^
main.c:9:15: warning: format specifies type 'int *' but the argument has type 'unsigned long long *' [-Wformat]
  scanf("%d", &num1);
         ~~   ^~~~~
         %lld
main.c:10:15: warning: format specifies type 'int *' but the argument has type 'unsigned long long *' [-Wformat]
  scanf("%d", &num2);
         ~~   ^~~~~
         %lld
3 warnings generated.

                    
0.003 s 21 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;
                                ^
main.c:9:15: warning: format specifies type 'int *' but the argument has type 'unsigned long long *' [-Wformat]
  scanf("%d", &num1);
         ~~   ^~~~~
         %lld
main.c:10:15: warning: format specifies type 'int *' but the argument has type 'unsigned long long *' [-Wformat]
  scanf("%d", &num2);
         ~~   ^~~~~
         %lld
3 warnings generated.

                    
0.003 s 4 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;
                                ^
main.c:9:15: warning: format specifies type 'int *' but the argument has type 'unsigned long long *' [-Wformat]
  scanf("%d", &num1);
         ~~   ^~~~~
         %lld
main.c:10:15: warning: format specifies type 'int *' but the argument has type 'unsigned long long *' [-Wformat]
  scanf("%d", &num2);
         ~~   ^~~~~
         %lld
3 warnings generated.

                    
0.002 s 2 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;
                                ^
main.c:9:15: warning: format specifies type 'int *' but the argument has type 'unsigned long long *' [-Wformat]
  scanf("%d", &num1);
         ~~   ^~~~~
         %lld
main.c:10:15: warning: format specifies type 'int *' but the argument has type 'unsigned long long *' [-Wformat]
  scanf("%d", &num2);
         ~~   ^~~~~
         %lld
3 warnings 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;
                                ^
main.c:9:15: warning: format specifies type 'int *' but the argument has type 'unsigned long long *' [-Wformat]
  scanf("%d", &num1);
         ~~   ^~~~~
         %lld
main.c:10:15: warning: format specifies type 'int *' but the argument has type 'unsigned long long *' [-Wformat]
  scanf("%d", &num2);
         ~~   ^~~~~
         %lld
3 warnings generated.

                    
0.002 s 3 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;
                                ^
main.c:9:15: warning: format specifies type 'int *' but the argument has type 'unsigned long long *' [-Wformat]
  scanf("%d", &num1);
         ~~   ^~~~~
         %lld
main.c:10:15: warning: format specifies type 'int *' but the argument has type 'unsigned long long *' [-Wformat]
  scanf("%d", &num2);
         ~~   ^~~~~
         %lld
3 warnings generated.

                    
0.004 s 10 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;
                                ^
main.c:9:15: warning: format specifies type 'int *' but the argument has type 'unsigned long long *' [-Wformat]
  scanf("%d", &num1);
         ~~   ^~~~~
         %lld
main.c:10:15: warning: format specifies type 'int *' but the argument has type 'unsigned long long *' [-Wformat]
  scanf("%d", &num2);
         ~~   ^~~~~
         %lld
3 warnings generated.

                    
0.004 s 50 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;
                                ^
main.c:9:15: warning: format specifies type 'int *' but the argument has type 'unsigned long long *' [-Wformat]
  scanf("%d", &num1);
         ~~   ^~~~~
         %lld
main.c:10:15: warning: format specifies type 'int *' but the argument has type 'unsigned long long *' [-Wformat]
  scanf("%d", &num2);
         ~~   ^~~~~
         %lld
3 warnings generated.

                    
0.005 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;
                                ^
main.c:9:15: warning: format specifies type 'int *' but the argument has type 'unsigned long long *' [-Wformat]
  scanf("%d", &num1);
         ~~   ^~~~~
         %lld
main.c:10:15: warning: format specifies type 'int *' but the argument has type 'unsigned long long *' [-Wformat]
  scanf("%d", &num2);
         ~~   ^~~~~
         %lld
3 warnings generated.

                    
0.003 s 3 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;
                                ^
main.c:9:15: warning: format specifies type 'int *' but the argument has type 'unsigned long long *' [-Wformat]
  scanf("%d", &num1);
         ~~   ^~~~~
         %lld
main.c:10:15: warning: format specifies type 'int *' but the argument has type 'unsigned long long *' [-Wformat]
  scanf("%d", &num2);
         ~~   ^~~~~
         %lld
3 warnings generated.

                    
0.005 s 0 KBi
#24
Incorrecto
                      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;
                                ^
main.c:9:15: warning: format specifies type 'int *' but the argument has type 'unsigned long long *' [-Wformat]
  scanf("%d", &num1);
         ~~   ^~~~~
         %lld
main.c:10:15: warning: format specifies type 'int *' but the argument has type 'unsigned long long *' [-Wformat]
  scanf("%d", &num2);
         ~~   ^~~~~
         %lld
3 warnings generated.

                    
0.005 s 0 KBi
#25
Incorrecto
                      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;
                                ^
main.c:9:15: warning: format specifies type 'int *' but the argument has type 'unsigned long long *' [-Wformat]
  scanf("%d", &num1);
         ~~   ^~~~~
         %lld
main.c:10:15: warning: format specifies type 'int *' but the argument has type 'unsigned long long *' [-Wformat]
  scanf("%d", &num2);
         ~~   ^~~~~
         %lld
3 warnings generated.

                    
0.003 s 0 KBi
#26
Incorrecto
                      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;
                                ^
main.c:9:15: warning: format specifies type 'int *' but the argument has type 'unsigned long long *' [-Wformat]
  scanf("%d", &num1);
         ~~   ^~~~~
         %lld
main.c:10:15: warning: format specifies type 'int *' but the argument has type 'unsigned long long *' [-Wformat]
  scanf("%d", &num2);
         ~~   ^~~~~
         %lld
3 warnings generated.

                    
0.003 s 0 KBi
#27
Incorrecto
                      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;
                                ^
main.c:9:15: warning: format specifies type 'int *' but the argument has type 'unsigned long long *' [-Wformat]
  scanf("%d", &num1);
         ~~   ^~~~~
         %lld
main.c:10:15: warning: format specifies type 'int *' but the argument has type 'unsigned long long *' [-Wformat]
  scanf("%d", &num2);
         ~~   ^~~~~
         %lld
3 warnings generated.

                    
0.003 s 0 KBi
#28
Incorrecto
                      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;
                                ^
main.c:9:15: warning: format specifies type 'int *' but the argument has type 'unsigned long long *' [-Wformat]
  scanf("%d", &num1);
         ~~   ^~~~~
         %lld
main.c:10:15: warning: format specifies type 'int *' but the argument has type 'unsigned long long *' [-Wformat]
  scanf("%d", &num2);
         ~~   ^~~~~
         %lld
3 warnings generated.

                    
0.003 s 41 KBi
#29
Incorrecto
                      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;
                                ^
main.c:9:15: warning: format specifies type 'int *' but the argument has type 'unsigned long long *' [-Wformat]
  scanf("%d", &num1);
         ~~   ^~~~~
         %lld
main.c:10:15: warning: format specifies type 'int *' but the argument has type 'unsigned long long *' [-Wformat]
  scanf("%d", &num2);
         ~~   ^~~~~
         %lld
3 warnings generated.

                    
0.003 s 0 KBi
Puntos totales: 52 / 100

Código

#include <stdio.h>

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

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

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

  return 0;
}