1198 - O Bravo Guerreiro Hashmat
Um problema absolutamente bacana.
Descrição
Solução
Basicamente calcular a diferença absoluta de soldados entre os dois exércitos.
Dito isso, não é necessário usar BigInt em JavaScript!
#include <stdlib.h>
#include <stdio.h>
int main()
{
long long int hashmat, oponente;
while (scanf("%lld %lld", &hashmat, &oponente) != EOF)
{
printf("%lld\n", hashmat > oponente ? hashmat - oponente : oponente - hashmat);
}
return 0;
}
Last updated
Was this helpful?