Submission #10379787


Source Code Expand

def main():
    d, g = [int(e) for e in input().split()]
    P, C = zip(*[[int(e) for e in input().split()] for i in range(d)])

    A = []
    for b in [format(i, '0{}b'.format(d)) for i in range(2**d)]:
        count = 0
        score = 0
        for ci, c in enumerate(b):
            if c == '1':
                count += P[-ci - 1]
                score += P[-ci - 1]*(d - ci)*100 + C[-ci - 1]

        if score >= g:
            A.append(count)
            continue

        for i in range(P[-b.index('0') - 1]):
            count += 1
            score += 100*(d - b.index('0'))
            if score >= g:
                A.append(count)
                break

    print(min(A))

if __name__ == "__main__":
    main()

Submission Info

Submission Time
Task C - All Green
User iys5
Language PyPy3 (2.4.0)
Score 300
Code Size 753 Byte
Status AC
Exec Time 199 ms
Memory 40560 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 4
AC × 24
Set Name Test Cases
Sample a01, a02, a03, a04
All a01, a02, a03, a04, b05, b06, b07, b08, b09, b10, b11, b12, b13, b14, b15, b16, b17, b18, b19, b20, b21, b22, b23, b24
Case Name Status Exec Time Memory
a01 AC 162 ms 38256 KB
a02 AC 163 ms 38256 KB
a03 AC 162 ms 38256 KB
a04 AC 163 ms 38256 KB
b05 AC 163 ms 38256 KB
b06 AC 184 ms 40048 KB
b07 AC 181 ms 40048 KB
b08 AC 163 ms 38256 KB
b09 AC 162 ms 38256 KB
b10 AC 163 ms 38256 KB
b11 AC 164 ms 38256 KB
b12 AC 180 ms 39664 KB
b13 AC 179 ms 39664 KB
b14 AC 183 ms 39920 KB
b15 AC 187 ms 40304 KB
b16 AC 183 ms 40048 KB
b17 AC 188 ms 40304 KB
b18 AC 190 ms 40176 KB
b19 AC 184 ms 39536 KB
b20 AC 178 ms 39152 KB
b21 AC 199 ms 40560 KB
b22 AC 188 ms 40432 KB
b23 AC 183 ms 40048 KB
b24 AC 191 ms 40560 KB