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

Envío 6643

Problema 0xb0 - Implementar una cola de prioridad

  • Autor: carrillodev
  • Fecha: 2022-09-23 05:50:45 UTC (Hace alrededor de 2 años)
Caso # Resultado Tiempo Memoria
#1
Correcto
                      main.cpp:64:45: warning: '&&' within '||' [-Wlogical-op-parentheses]
    if(leftValues.first > rightValues.first && leftValues.first > currValues.first
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:64:45: note: place parentheses around the '&&' expression to silence this warning
    if(leftValues.first > rightValues.first && leftValues.first > currValues.first
                                            ^
       (                                                                          )
main.cpp:65:45: warning: '&&' within '||' [-Wlogical-op-parentheses]
    || leftValues.first == currValues.first && leftValues.second < currValues.second) {
    ~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:65:45: note: place parentheses around the '&&' expression to silence this warning
    || leftValues.first == currValues.first && leftValues.second < currValues.second) {
                                            ^
       (                                                                            )
main.cpp:69:52: warning: '&&' within '||' [-Wlogical-op-parentheses]
    } else if(rightValues.first > leftValues.first && rightValues.first > currValues.first
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:69:52: note: place parentheses around the '&&' expression to silence this warning
    } else if(rightValues.first > leftValues.first && rightValues.first > currValues.first
                                                   ^
              (                                                                           )
main.cpp:70:46: warning: '&&' within '||' [-Wlogical-op-parentheses]
    || rightValues.first == currValues.first && rightValues.second < currValues.second) {
    ~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:70:46: note: place parentheses around the '&&' expression to silence this warning
    || rightValues.first == currValues.first && rightValues.second < currValues.second) {
                                             ^
       (                                                                              )
4 warnings generated.

                    
0.004 s 1 KBi
#2
Correcto
                      main.cpp:64:45: warning: '&&' within '||' [-Wlogical-op-parentheses]
    if(leftValues.first > rightValues.first && leftValues.first > currValues.first
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:64:45: note: place parentheses around the '&&' expression to silence this warning
    if(leftValues.first > rightValues.first && leftValues.first > currValues.first
                                            ^
       (                                                                          )
main.cpp:65:45: warning: '&&' within '||' [-Wlogical-op-parentheses]
    || leftValues.first == currValues.first && leftValues.second < currValues.second) {
    ~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:65:45: note: place parentheses around the '&&' expression to silence this warning
    || leftValues.first == currValues.first && leftValues.second < currValues.second) {
                                            ^
       (                                                                            )
main.cpp:69:52: warning: '&&' within '||' [-Wlogical-op-parentheses]
    } else if(rightValues.first > leftValues.first && rightValues.first > currValues.first
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:69:52: note: place parentheses around the '&&' expression to silence this warning
    } else if(rightValues.first > leftValues.first && rightValues.first > currValues.first
                                                   ^
              (                                                                           )
main.cpp:70:46: warning: '&&' within '||' [-Wlogical-op-parentheses]
    || rightValues.first == currValues.first && rightValues.second < currValues.second) {
    ~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:70:46: note: place parentheses around the '&&' expression to silence this warning
    || rightValues.first == currValues.first && rightValues.second < currValues.second) {
                                             ^
       (                                                                              )
4 warnings generated.

                    
0.005 s 2 KBi
#3
Correcto
                      main.cpp:64:45: warning: '&&' within '||' [-Wlogical-op-parentheses]
    if(leftValues.first > rightValues.first && leftValues.first > currValues.first
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:64:45: note: place parentheses around the '&&' expression to silence this warning
    if(leftValues.first > rightValues.first && leftValues.first > currValues.first
                                            ^
       (                                                                          )
main.cpp:65:45: warning: '&&' within '||' [-Wlogical-op-parentheses]
    || leftValues.first == currValues.first && leftValues.second < currValues.second) {
    ~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:65:45: note: place parentheses around the '&&' expression to silence this warning
    || leftValues.first == currValues.first && leftValues.second < currValues.second) {
                                            ^
       (                                                                            )
main.cpp:69:52: warning: '&&' within '||' [-Wlogical-op-parentheses]
    } else if(rightValues.first > leftValues.first && rightValues.first > currValues.first
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:69:52: note: place parentheses around the '&&' expression to silence this warning
    } else if(rightValues.first > leftValues.first && rightValues.first > currValues.first
                                                   ^
              (                                                                           )
main.cpp:70:46: warning: '&&' within '||' [-Wlogical-op-parentheses]
    || rightValues.first == currValues.first && rightValues.second < currValues.second) {
    ~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:70:46: note: place parentheses around the '&&' expression to silence this warning
    || rightValues.first == currValues.first && rightValues.second < currValues.second) {
                                             ^
       (                                                                              )
4 warnings generated.

                    
0.005 s 3 KBi
#4
Correcto
                      main.cpp:64:45: warning: '&&' within '||' [-Wlogical-op-parentheses]
    if(leftValues.first > rightValues.first && leftValues.first > currValues.first
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:64:45: note: place parentheses around the '&&' expression to silence this warning
    if(leftValues.first > rightValues.first && leftValues.first > currValues.first
                                            ^
       (                                                                          )
main.cpp:65:45: warning: '&&' within '||' [-Wlogical-op-parentheses]
    || leftValues.first == currValues.first && leftValues.second < currValues.second) {
    ~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:65:45: note: place parentheses around the '&&' expression to silence this warning
    || leftValues.first == currValues.first && leftValues.second < currValues.second) {
                                            ^
       (                                                                            )
main.cpp:69:52: warning: '&&' within '||' [-Wlogical-op-parentheses]
    } else if(rightValues.first > leftValues.first && rightValues.first > currValues.first
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:69:52: note: place parentheses around the '&&' expression to silence this warning
    } else if(rightValues.first > leftValues.first && rightValues.first > currValues.first
                                                   ^
              (                                                                           )
main.cpp:70:46: warning: '&&' within '||' [-Wlogical-op-parentheses]
    || rightValues.first == currValues.first && rightValues.second < currValues.second) {
    ~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:70:46: note: place parentheses around the '&&' expression to silence this warning
    || rightValues.first == currValues.first && rightValues.second < currValues.second) {
                                             ^
       (                                                                              )
4 warnings generated.

                    
0.005 s 1 KBi
#5
Correcto
                      main.cpp:64:45: warning: '&&' within '||' [-Wlogical-op-parentheses]
    if(leftValues.first > rightValues.first && leftValues.first > currValues.first
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:64:45: note: place parentheses around the '&&' expression to silence this warning
    if(leftValues.first > rightValues.first && leftValues.first > currValues.first
                                            ^
       (                                                                          )
main.cpp:65:45: warning: '&&' within '||' [-Wlogical-op-parentheses]
    || leftValues.first == currValues.first && leftValues.second < currValues.second) {
    ~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:65:45: note: place parentheses around the '&&' expression to silence this warning
    || leftValues.first == currValues.first && leftValues.second < currValues.second) {
                                            ^
       (                                                                            )
main.cpp:69:52: warning: '&&' within '||' [-Wlogical-op-parentheses]
    } else if(rightValues.first > leftValues.first && rightValues.first > currValues.first
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:69:52: note: place parentheses around the '&&' expression to silence this warning
    } else if(rightValues.first > leftValues.first && rightValues.first > currValues.first
                                                   ^
              (                                                                           )
main.cpp:70:46: warning: '&&' within '||' [-Wlogical-op-parentheses]
    || rightValues.first == currValues.first && rightValues.second < currValues.second) {
    ~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:70:46: note: place parentheses around the '&&' expression to silence this warning
    || rightValues.first == currValues.first && rightValues.second < currValues.second) {
                                             ^
       (                                                                              )
4 warnings generated.

                    
0.005 s 1 KBi
#6
Incorrecto
                      main.cpp:64:45: warning: '&&' within '||' [-Wlogical-op-parentheses]
    if(leftValues.first > rightValues.first && leftValues.first > currValues.first
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:64:45: note: place parentheses around the '&&' expression to silence this warning
    if(leftValues.first > rightValues.first && leftValues.first > currValues.first
                                            ^
       (                                                                          )
main.cpp:65:45: warning: '&&' within '||' [-Wlogical-op-parentheses]
    || leftValues.first == currValues.first && leftValues.second < currValues.second) {
    ~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:65:45: note: place parentheses around the '&&' expression to silence this warning
    || leftValues.first == currValues.first && leftValues.second < currValues.second) {
                                            ^
       (                                                                            )
main.cpp:69:52: warning: '&&' within '||' [-Wlogical-op-parentheses]
    } else if(rightValues.first > leftValues.first && rightValues.first > currValues.first
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:69:52: note: place parentheses around the '&&' expression to silence this warning
    } else if(rightValues.first > leftValues.first && rightValues.first > currValues.first
                                                   ^
              (                                                                           )
main.cpp:70:46: warning: '&&' within '||' [-Wlogical-op-parentheses]
    || rightValues.first == currValues.first && rightValues.second < currValues.second) {
    ~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:70:46: note: place parentheses around the '&&' expression to silence this warning
    || rightValues.first == currValues.first && rightValues.second < currValues.second) {
                                             ^
       (                                                                              )
4 warnings generated.

                    
0.004 s 2 KBi
#7
Correcto
                      main.cpp:64:45: warning: '&&' within '||' [-Wlogical-op-parentheses]
    if(leftValues.first > rightValues.first && leftValues.first > currValues.first
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:64:45: note: place parentheses around the '&&' expression to silence this warning
    if(leftValues.first > rightValues.first && leftValues.first > currValues.first
                                            ^
       (                                                                          )
main.cpp:65:45: warning: '&&' within '||' [-Wlogical-op-parentheses]
    || leftValues.first == currValues.first && leftValues.second < currValues.second) {
    ~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:65:45: note: place parentheses around the '&&' expression to silence this warning
    || leftValues.first == currValues.first && leftValues.second < currValues.second) {
                                            ^
       (                                                                            )
main.cpp:69:52: warning: '&&' within '||' [-Wlogical-op-parentheses]
    } else if(rightValues.first > leftValues.first && rightValues.first > currValues.first
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:69:52: note: place parentheses around the '&&' expression to silence this warning
    } else if(rightValues.first > leftValues.first && rightValues.first > currValues.first
                                                   ^
              (                                                                           )
main.cpp:70:46: warning: '&&' within '||' [-Wlogical-op-parentheses]
    || rightValues.first == currValues.first && rightValues.second < currValues.second) {
    ~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:70:46: note: place parentheses around the '&&' expression to silence this warning
    || rightValues.first == currValues.first && rightValues.second < currValues.second) {
                                             ^
       (                                                                              )
4 warnings generated.

                    
0.005 s 5 KBi
#8
Error en tiempo de ejecución (NZEC)
                      main.cpp:64:45: warning: '&&' within '||' [-Wlogical-op-parentheses]
    if(leftValues.first > rightValues.first && leftValues.first > currValues.first
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:64:45: note: place parentheses around the '&&' expression to silence this warning
    if(leftValues.first > rightValues.first && leftValues.first > currValues.first
                                            ^
       (                                                                          )
main.cpp:65:45: warning: '&&' within '||' [-Wlogical-op-parentheses]
    || leftValues.first == currValues.first && leftValues.second < currValues.second) {
    ~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:65:45: note: place parentheses around the '&&' expression to silence this warning
    || leftValues.first == currValues.first && leftValues.second < currValues.second) {
                                            ^
       (                                                                            )
main.cpp:69:52: warning: '&&' within '||' [-Wlogical-op-parentheses]
    } else if(rightValues.first > leftValues.first && rightValues.first > currValues.first
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:69:52: note: place parentheses around the '&&' expression to silence this warning
    } else if(rightValues.first > leftValues.first && rightValues.first > currValues.first
                                                   ^
              (                                                                           )
main.cpp:70:46: warning: '&&' within '||' [-Wlogical-op-parentheses]
    || rightValues.first == currValues.first && rightValues.second < currValues.second) {
    ~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:70:46: note: place parentheses around the '&&' expression to silence this warning
    || rightValues.first == currValues.first && rightValues.second < currValues.second) {
                                             ^
       (                                                                              )
4 warnings generated.

                    
Exited with error status 139
run: line 1:     3 Segmentation fault      (core dumped) ./a.out
0.005 s 3 KBi
#9
Error en tiempo de ejecución (NZEC)
                      main.cpp:64:45: warning: '&&' within '||' [-Wlogical-op-parentheses]
    if(leftValues.first > rightValues.first && leftValues.first > currValues.first
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:64:45: note: place parentheses around the '&&' expression to silence this warning
    if(leftValues.first > rightValues.first && leftValues.first > currValues.first
                                            ^
       (                                                                          )
main.cpp:65:45: warning: '&&' within '||' [-Wlogical-op-parentheses]
    || leftValues.first == currValues.first && leftValues.second < currValues.second) {
    ~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:65:45: note: place parentheses around the '&&' expression to silence this warning
    || leftValues.first == currValues.first && leftValues.second < currValues.second) {
                                            ^
       (                                                                            )
main.cpp:69:52: warning: '&&' within '||' [-Wlogical-op-parentheses]
    } else if(rightValues.first > leftValues.first && rightValues.first > currValues.first
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:69:52: note: place parentheses around the '&&' expression to silence this warning
    } else if(rightValues.first > leftValues.first && rightValues.first > currValues.first
                                                   ^
              (                                                                           )
main.cpp:70:46: warning: '&&' within '||' [-Wlogical-op-parentheses]
    || rightValues.first == currValues.first && rightValues.second < currValues.second) {
    ~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:70:46: note: place parentheses around the '&&' expression to silence this warning
    || rightValues.first == currValues.first && rightValues.second < currValues.second) {
                                             ^
       (                                                                              )
4 warnings generated.

                    
Exited with error status 139
run: line 1:     3 Segmentation fault      (core dumped) ./a.out
0.005 s 10 KBi
#10
Error en tiempo de ejecución (NZEC)
                      main.cpp:64:45: warning: '&&' within '||' [-Wlogical-op-parentheses]
    if(leftValues.first > rightValues.first && leftValues.first > currValues.first
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:64:45: note: place parentheses around the '&&' expression to silence this warning
    if(leftValues.first > rightValues.first && leftValues.first > currValues.first
                                            ^
       (                                                                          )
main.cpp:65:45: warning: '&&' within '||' [-Wlogical-op-parentheses]
    || leftValues.first == currValues.first && leftValues.second < currValues.second) {
    ~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:65:45: note: place parentheses around the '&&' expression to silence this warning
    || leftValues.first == currValues.first && leftValues.second < currValues.second) {
                                            ^
       (                                                                            )
main.cpp:69:52: warning: '&&' within '||' [-Wlogical-op-parentheses]
    } else if(rightValues.first > leftValues.first && rightValues.first > currValues.first
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:69:52: note: place parentheses around the '&&' expression to silence this warning
    } else if(rightValues.first > leftValues.first && rightValues.first > currValues.first
                                                   ^
              (                                                                           )
main.cpp:70:46: warning: '&&' within '||' [-Wlogical-op-parentheses]
    || rightValues.first == currValues.first && rightValues.second < currValues.second) {
    ~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:70:46: note: place parentheses around the '&&' expression to silence this warning
    || rightValues.first == currValues.first && rightValues.second < currValues.second) {
                                             ^
       (                                                                              )
4 warnings generated.

                    
Exited with error status 139
run: line 1:     3 Segmentation fault      (core dumped) ./a.out
0.006 s 8 KBi
#11
Error en tiempo de ejecución (NZEC)
                      main.cpp:64:45: warning: '&&' within '||' [-Wlogical-op-parentheses]
    if(leftValues.first > rightValues.first && leftValues.first > currValues.first
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:64:45: note: place parentheses around the '&&' expression to silence this warning
    if(leftValues.first > rightValues.first && leftValues.first > currValues.first
                                            ^
       (                                                                          )
main.cpp:65:45: warning: '&&' within '||' [-Wlogical-op-parentheses]
    || leftValues.first == currValues.first && leftValues.second < currValues.second) {
    ~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:65:45: note: place parentheses around the '&&' expression to silence this warning
    || leftValues.first == currValues.first && leftValues.second < currValues.second) {
                                            ^
       (                                                                            )
main.cpp:69:52: warning: '&&' within '||' [-Wlogical-op-parentheses]
    } else if(rightValues.first > leftValues.first && rightValues.first > currValues.first
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:69:52: note: place parentheses around the '&&' expression to silence this warning
    } else if(rightValues.first > leftValues.first && rightValues.first > currValues.first
                                                   ^
              (                                                                           )
main.cpp:70:46: warning: '&&' within '||' [-Wlogical-op-parentheses]
    || rightValues.first == currValues.first && rightValues.second < currValues.second) {
    ~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:70:46: note: place parentheses around the '&&' expression to silence this warning
    || rightValues.first == currValues.first && rightValues.second < currValues.second) {
                                             ^
       (                                                                              )
4 warnings generated.

                    
Exited with error status 139
run: line 1:     3 Segmentation fault      (core dumped) ./a.out
0.006 s 9 KBi
#12
Error en tiempo de ejecución (NZEC)
                      main.cpp:64:45: warning: '&&' within '||' [-Wlogical-op-parentheses]
    if(leftValues.first > rightValues.first && leftValues.first > currValues.first
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:64:45: note: place parentheses around the '&&' expression to silence this warning
    if(leftValues.first > rightValues.first && leftValues.first > currValues.first
                                            ^
       (                                                                          )
main.cpp:65:45: warning: '&&' within '||' [-Wlogical-op-parentheses]
    || leftValues.first == currValues.first && leftValues.second < currValues.second) {
    ~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:65:45: note: place parentheses around the '&&' expression to silence this warning
    || leftValues.first == currValues.first && leftValues.second < currValues.second) {
                                            ^
       (                                                                            )
main.cpp:69:52: warning: '&&' within '||' [-Wlogical-op-parentheses]
    } else if(rightValues.first > leftValues.first && rightValues.first > currValues.first
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:69:52: note: place parentheses around the '&&' expression to silence this warning
    } else if(rightValues.first > leftValues.first && rightValues.first > currValues.first
                                                   ^
              (                                                                           )
main.cpp:70:46: warning: '&&' within '||' [-Wlogical-op-parentheses]
    || rightValues.first == currValues.first && rightValues.second < currValues.second) {
    ~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:70:46: note: place parentheses around the '&&' expression to silence this warning
    || rightValues.first == currValues.first && rightValues.second < currValues.second) {
                                             ^
       (                                                                              )
4 warnings generated.

                    
Exited with error status 139
run: line 1:     3 Segmentation fault      (core dumped) ./a.out
0.005 s 1 KBi
#13
Error en tiempo de ejecución (NZEC)
                      main.cpp:64:45: warning: '&&' within '||' [-Wlogical-op-parentheses]
    if(leftValues.first > rightValues.first && leftValues.first > currValues.first
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:64:45: note: place parentheses around the '&&' expression to silence this warning
    if(leftValues.first > rightValues.first && leftValues.first > currValues.first
                                            ^
       (                                                                          )
main.cpp:65:45: warning: '&&' within '||' [-Wlogical-op-parentheses]
    || leftValues.first == currValues.first && leftValues.second < currValues.second) {
    ~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:65:45: note: place parentheses around the '&&' expression to silence this warning
    || leftValues.first == currValues.first && leftValues.second < currValues.second) {
                                            ^
       (                                                                            )
main.cpp:69:52: warning: '&&' within '||' [-Wlogical-op-parentheses]
    } else if(rightValues.first > leftValues.first && rightValues.first > currValues.first
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:69:52: note: place parentheses around the '&&' expression to silence this warning
    } else if(rightValues.first > leftValues.first && rightValues.first > currValues.first
                                                   ^
              (                                                                           )
main.cpp:70:46: warning: '&&' within '||' [-Wlogical-op-parentheses]
    || rightValues.first == currValues.first && rightValues.second < currValues.second) {
    ~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:70:46: note: place parentheses around the '&&' expression to silence this warning
    || rightValues.first == currValues.first && rightValues.second < currValues.second) {
                                             ^
       (                                                                              )
4 warnings generated.

                    
Exited with error status 139
run: line 1:     3 Segmentation fault      (core dumped) ./a.out
0.006 s 1 KBi
#14
Error en tiempo de ejecución (NZEC)
                      main.cpp:64:45: warning: '&&' within '||' [-Wlogical-op-parentheses]
    if(leftValues.first > rightValues.first && leftValues.first > currValues.first
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:64:45: note: place parentheses around the '&&' expression to silence this warning
    if(leftValues.first > rightValues.first && leftValues.first > currValues.first
                                            ^
       (                                                                          )
main.cpp:65:45: warning: '&&' within '||' [-Wlogical-op-parentheses]
    || leftValues.first == currValues.first && leftValues.second < currValues.second) {
    ~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:65:45: note: place parentheses around the '&&' expression to silence this warning
    || leftValues.first == currValues.first && leftValues.second < currValues.second) {
                                            ^
       (                                                                            )
main.cpp:69:52: warning: '&&' within '||' [-Wlogical-op-parentheses]
    } else if(rightValues.first > leftValues.first && rightValues.first > currValues.first
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:69:52: note: place parentheses around the '&&' expression to silence this warning
    } else if(rightValues.first > leftValues.first && rightValues.first > currValues.first
                                                   ^
              (                                                                           )
main.cpp:70:46: warning: '&&' within '||' [-Wlogical-op-parentheses]
    || rightValues.first == currValues.first && rightValues.second < currValues.second) {
    ~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:70:46: note: place parentheses around the '&&' expression to silence this warning
    || rightValues.first == currValues.first && rightValues.second < currValues.second) {
                                             ^
       (                                                                              )
4 warnings generated.

                    
Exited with error status 139
run: line 1:     3 Segmentation fault      (core dumped) ./a.out
0.005 s 1 KBi
#15
Error en tiempo de ejecución (NZEC)
                      main.cpp:64:45: warning: '&&' within '||' [-Wlogical-op-parentheses]
    if(leftValues.first > rightValues.first && leftValues.first > currValues.first
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:64:45: note: place parentheses around the '&&' expression to silence this warning
    if(leftValues.first > rightValues.first && leftValues.first > currValues.first
                                            ^
       (                                                                          )
main.cpp:65:45: warning: '&&' within '||' [-Wlogical-op-parentheses]
    || leftValues.first == currValues.first && leftValues.second < currValues.second) {
    ~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:65:45: note: place parentheses around the '&&' expression to silence this warning
    || leftValues.first == currValues.first && leftValues.second < currValues.second) {
                                            ^
       (                                                                            )
main.cpp:69:52: warning: '&&' within '||' [-Wlogical-op-parentheses]
    } else if(rightValues.first > leftValues.first && rightValues.first > currValues.first
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:69:52: note: place parentheses around the '&&' expression to silence this warning
    } else if(rightValues.first > leftValues.first && rightValues.first > currValues.first
                                                   ^
              (                                                                           )
main.cpp:70:46: warning: '&&' within '||' [-Wlogical-op-parentheses]
    || rightValues.first == currValues.first && rightValues.second < currValues.second) {
    ~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:70:46: note: place parentheses around the '&&' expression to silence this warning
    || rightValues.first == currValues.first && rightValues.second < currValues.second) {
                                             ^
       (                                                                              )
4 warnings generated.

                    
Exited with error status 139
run: line 1:     3 Segmentation fault      (core dumped) ./a.out
0.006 s 1 KBi
#16
Error en tiempo de ejecución (NZEC)
                      main.cpp:64:45: warning: '&&' within '||' [-Wlogical-op-parentheses]
    if(leftValues.first > rightValues.first && leftValues.first > currValues.first
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:64:45: note: place parentheses around the '&&' expression to silence this warning
    if(leftValues.first > rightValues.first && leftValues.first > currValues.first
                                            ^
       (                                                                          )
main.cpp:65:45: warning: '&&' within '||' [-Wlogical-op-parentheses]
    || leftValues.first == currValues.first && leftValues.second < currValues.second) {
    ~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:65:45: note: place parentheses around the '&&' expression to silence this warning
    || leftValues.first == currValues.first && leftValues.second < currValues.second) {
                                            ^
       (                                                                            )
main.cpp:69:52: warning: '&&' within '||' [-Wlogical-op-parentheses]
    } else if(rightValues.first > leftValues.first && rightValues.first > currValues.first
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:69:52: note: place parentheses around the '&&' expression to silence this warning
    } else if(rightValues.first > leftValues.first && rightValues.first > currValues.first
                                                   ^
              (                                                                           )
main.cpp:70:46: warning: '&&' within '||' [-Wlogical-op-parentheses]
    || rightValues.first == currValues.first && rightValues.second < currValues.second) {
    ~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:70:46: note: place parentheses around the '&&' expression to silence this warning
    || rightValues.first == currValues.first && rightValues.second < currValues.second) {
                                             ^
       (                                                                              )
4 warnings generated.

                    
Exited with error status 139
run: line 1:     3 Segmentation fault      (core dumped) ./a.out
0.005 s 1 KBi
#17
Error en tiempo de ejecución (NZEC)
                      main.cpp:64:45: warning: '&&' within '||' [-Wlogical-op-parentheses]
    if(leftValues.first > rightValues.first && leftValues.first > currValues.first
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:64:45: note: place parentheses around the '&&' expression to silence this warning
    if(leftValues.first > rightValues.first && leftValues.first > currValues.first
                                            ^
       (                                                                          )
main.cpp:65:45: warning: '&&' within '||' [-Wlogical-op-parentheses]
    || leftValues.first == currValues.first && leftValues.second < currValues.second) {
    ~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:65:45: note: place parentheses around the '&&' expression to silence this warning
    || leftValues.first == currValues.first && leftValues.second < currValues.second) {
                                            ^
       (                                                                            )
main.cpp:69:52: warning: '&&' within '||' [-Wlogical-op-parentheses]
    } else if(rightValues.first > leftValues.first && rightValues.first > currValues.first
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:69:52: note: place parentheses around the '&&' expression to silence this warning
    } else if(rightValues.first > leftValues.first && rightValues.first > currValues.first
                                                   ^
              (                                                                           )
main.cpp:70:46: warning: '&&' within '||' [-Wlogical-op-parentheses]
    || rightValues.first == currValues.first && rightValues.second < currValues.second) {
    ~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:70:46: note: place parentheses around the '&&' expression to silence this warning
    || rightValues.first == currValues.first && rightValues.second < currValues.second) {
                                             ^
       (                                                                              )
4 warnings generated.

                    
Exited with error status 139
run: line 1:     3 Segmentation fault      (core dumped) ./a.out
0.005 s 1 KBi
Puntos totales: 36 / 100

Código

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

class MyHeap {
    vector<pair<int, string>> data;
    void heapifyUp(int index);
    void heapifyDown(int index);
    int parent(int index);
    int leftChild(int index);
    int rightChild(int index);

public:
    MyHeap();
    void insert(int priority, string name);
    string getMax();
    void popMax();
    int length;
};

MyHeap::MyHeap() {
    vector<pair<int, string>> tmp(10, make_pair(-1, ""));
    this->length = 0;
    this->data = tmp;
}
int MyHeap::parent(int index) {
    return (index - 1) / 2;
}
int MyHeap::leftChild(int index) {
    return index * 2 + 1;
}
int MyHeap::rightChild(int index) {
    return  index * 2 + 2;
}
void MyHeap::heapifyUp(int index) {
    if(index == 0) {
        return;
    }

    int p = this->parent(index);
    pair<int, string> parentValues = this->data[p];
    pair<int, string> currValues = this->data[index];

    if((parentValues.first < currValues.first) ||
    (parentValues.first == currValues.first && currValues.second < parentValues.second)) {
        this->data[index] = parentValues;
        this->data[p] = currValues;
        this->heapifyUp(p);
    }
}

void MyHeap::heapifyDown(int index) {
    int leftIndex = this->leftChild(index);
    int rightIndex = this->rightChild(index);
    if(index >= this->length || leftIndex >= this->length) {
        return;
    }

    pair<int, string> leftValues = this->data[leftIndex];
    pair<int, string> rightValues = this->data[rightIndex];
    pair<int, string> currValues = this->data[index];

    if(leftValues.first > rightValues.first && leftValues.first > currValues.first
    || leftValues.first == currValues.first && leftValues.second < currValues.second) {
        this->data[index] = leftValues;
        this->data[leftIndex] = currValues;
        this->heapifyDown(leftIndex);
    } else if(rightValues.first > leftValues.first && rightValues.first > currValues.first
    || rightValues.first == currValues.first && rightValues.second < currValues.second) {
        this->data[index] = rightValues;
        this->data[rightIndex] = currValues;
        this->heapifyDown(rightIndex);
    }
}
void MyHeap::insert(int priority, std::string name) {
    this->data[this->length] = make_pair(priority, name);
    this->heapifyUp(this->length);
    this->length++;
}
string MyHeap::getMax() {
    return this->data[0].second;
}
void MyHeap::popMax() {
    this->length--;
    if(this->length == 0) {
        this->data.clear();
        return;
    }
    this->data[0] = this->data[this->length];
    this->heapifyDown(0);
    return;
}


int main() {
    int n; cin>>n;
    MyHeap heap;
    while(n--) {
        string op; cin>>op;
        string x; int p;
        if(op == "Insert") {
            cin>>x>>p;
            heap.insert(p, x);
        } else if(op == "GetMax") {
            cout<<heap.getMax()<<endl;
        } else {
            heap.popMax();
        }
    }
    return 0;
}