¿Qué es 1LL o 2LL en C y C++?
Estaba mirando algunas de las soluciones en Google Code Jam y algunas personas usaron estas cosas que nunca había visto antes. Por ejemplo,
2LL*r+1LL
¿Qué significan 2LL y 1LL?
Sus inclusiones se ven así:
#include <math.h>
#include <algorithm>
#define _USE_MATH_DEFINES
O
#include <cmath>
28
1 answers
El LL
hace el entero literal de tipo long long
.
Así que 2LL
, es un 2 de tipo long long
.
Sin el LL
, el literal solo sería de tipo int
.
Esto importa cuando haces cosas como estas: {[12]]}
1 << 40
1LL << 40
Con solo el literal 1
, (suponiendo que int
sea de 32 bits, se desplaza más allá del tamaño del tipo entero- > comportamiento indefinido).
Con 1LL
, se establece el tipo a long long
antes de la mano y ahora devolverá correctamente 2^40.
53
Author: Kyurem,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2013-04-27 04:12:20
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2013-04-27 04:12:20