1. 문제
https://programmers.co.kr/learn/courses/30/lessons/82612
2. 풀이
long long solution(int price, int money, int count)
{
long long val = ((long long)price)*count*(count+1)/2 - money;
return val > 0 ? val : 0;
}
https://programmers.co.kr/learn/courses/30/lessons/82612
long long solution(int price, int money, int count)
{
long long val = ((long long)price)*count*(count+1)/2 - money;
return val > 0 ? val : 0;
}