100g of dry, uncooked pasta won't 'gain' any calories as it's cooked, but it will increase in weight (pasta generally doubles in weight when cooked). this means that 100g of dry pasta is not the same as 100g of cooked pasta. but 100g of cooked pasta was 50g of dry pasta.