We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Mathematics
- Fundamentals
- Filling Jars
- Discussions
Filling Jars
Filling Jars
Sort by
recency
|
201 Discussions
|
Please Login in order to post a comment
t = 0 for i in operations: t+=(i[1]-i[0]+1)*i[2] return int(t/n)
!/bin/python3
import math import os import random import re import sys
def solve(n, operations): count = 0 for i in range(m): l = operations[i] a = l[0] b = l[1] k = l[2] count += (b-a+1)*k return count//n
if name == 'main': fptr = open(os.environ['OUTPUT_PATH'], 'w')
what is wrong with c++ solution why all the test cases are not passing
For C++ solution change the return type of solve function to long long and also type of result variable in main function from where solve is being called.