Submission #10376993
Source Code Expand
import numpy as np from functools import reduce from operator import add,sub,mul,truediv from fractions import gcd d,g = map(int,input().split()) p = [] c = [] for _ in range(d): a,b = map(int,input().split()) p.append(a) c.append(b) ans = 1000000000 for bit in range(1 << d): score = 0 num = 0 x = [] for i in range(d): if (bit >>i)&1 == 0: x.append(i+1) else: # print(i) # print(p[i]) score = score + p[i]*(i+1)*100+c[i] num = num + p[i] # print(bin(bit)) # print(x[::-1]) flag = False for j in x[::-1]: for _ in range(p[j-1]): score = score + j*100 num = num +1 # print(score) # print(num) if score >= g: flag = True break # print(num) if flag : break # print(score) # print(num) # print("num:{}".format(num)) ans= min(ans,num) # print("$$$$$$$$$$$$$$$$$$$$$") print(ans)
Submission Info
Submission Time | |
---|---|
Task | C - All Green |
User | saillern |
Language | Python (3.4.3) |
Score | 0 |
Code Size | 1137 Byte |
Status | WA |
Exec Time | 277 ms |
Memory | 14216 KB |
Judge Result
Set Name | Sample | All | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 300 | ||||||||
Status |
|
|
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 | WA | 168 ms | 14216 KB |
a02 | AC | 155 ms | 13540 KB |
a03 | AC | 155 ms | 13512 KB |
a04 | AC | 156 ms | 13512 KB |
b05 | AC | 155 ms | 13512 KB |
b06 | AC | 277 ms | 13508 KB |
b07 | AC | 162 ms | 13508 KB |
b08 | WA | 154 ms | 13508 KB |
b09 | WA | 155 ms | 13512 KB |
b10 | WA | 156 ms | 13508 KB |
b11 | WA | 158 ms | 13512 KB |
b12 | WA | 171 ms | 13512 KB |
b13 | WA | 170 ms | 13508 KB |
b14 | WA | 193 ms | 13508 KB |
b15 | WA | 202 ms | 13384 KB |
b16 | WA | 217 ms | 13508 KB |
b17 | WA | 197 ms | 13512 KB |
b18 | WA | 183 ms | 13508 KB |
b19 | WA | 179 ms | 13508 KB |
b20 | WA | 162 ms | 13380 KB |
b21 | WA | 185 ms | 13508 KB |
b22 | WA | 184 ms | 13540 KB |
b23 | WA | 173 ms | 13508 KB |
b24 | WA | 189 ms | 13512 KB |