結果
問題 | No.5 数字のブロック |
ユーザー | harurun |
提出日時 | 2021-02-16 13:16:07 |
言語 | Python3 (3.12.2 + numpy 1.26.4 + scipy 1.12.0) |
結果 |
AC
|
実行時間 | 21 ms / 5,000 ms |
コード長 | 1,191 bytes |
コンパイル時間 | 135 ms |
コンパイル使用メモリ | 10,992 KB |
実行使用メモリ | 9,428 KB |
最終ジャッジ日時 | 2023-10-10 01:00:09 |
合計ジャッジ時間 | 2,634 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge14 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 17 ms
8,208 KB |
testcase_01 | AC | 17 ms
8,172 KB |
testcase_02 | AC | 17 ms
8,240 KB |
testcase_03 | AC | 20 ms
9,080 KB |
testcase_04 | AC | 18 ms
8,612 KB |
testcase_05 | AC | 20 ms
9,120 KB |
testcase_06 | AC | 18 ms
8,812 KB |
testcase_07 | AC | 18 ms
8,848 KB |
testcase_08 | AC | 19 ms
8,908 KB |
testcase_09 | AC | 17 ms
8,120 KB |
testcase_10 | AC | 20 ms
9,320 KB |
testcase_11 | AC | 19 ms
8,660 KB |
testcase_12 | AC | 20 ms
8,888 KB |
testcase_13 | AC | 21 ms
9,188 KB |
testcase_14 | AC | 18 ms
8,280 KB |
testcase_15 | AC | 16 ms
8,188 KB |
testcase_16 | AC | 20 ms
9,268 KB |
testcase_17 | AC | 20 ms
9,392 KB |
testcase_18 | AC | 21 ms
9,428 KB |
testcase_19 | AC | 21 ms
9,312 KB |
testcase_20 | AC | 16 ms
8,284 KB |
testcase_21 | AC | 16 ms
8,188 KB |
testcase_22 | AC | 16 ms
8,336 KB |
testcase_23 | AC | 17 ms
8,312 KB |
testcase_24 | AC | 16 ms
8,304 KB |
testcase_25 | AC | 16 ms
8,000 KB |
testcase_26 | AC | 16 ms
8,280 KB |
testcase_27 | AC | 16 ms
8,308 KB |
testcase_28 | AC | 17 ms
8,244 KB |
testcase_29 | AC | 18 ms
8,596 KB |
testcase_30 | AC | 17 ms
8,556 KB |
testcase_31 | AC | 16 ms
8,104 KB |
testcase_32 | AC | 16 ms
8,264 KB |
testcase_33 | AC | 16 ms
8,168 KB |
ソースコード
class INPUT: def __init__(self): self.l=open(0).read().split()[::-1] self.length=len(self.l) return def stream(self,k=1,f=int,f2=False): assert(-1<k) m=self.length if m==0 or m<k: raise Exception("There is no input!") elif f!=str: if k==0: self.length=0 return list(map(f,self.l[::-1])) if k==1 and not f2: self.length-=1 return f(self.l.pop()) if k==1 and f2: self.length-=1 return [f(self.l.pop())] ret=[] for _ in [0]*k: ret.append(f(self.l.pop())) self.length-=k return ret else: if k==0: self.length=0 return self.l[::-1] if k==1 and not f2: self.length-=1 return self.l.pop() if k==1 and f2: self.length-=1 return [self.l.pop()] ret=[] for _ in [0]*k: ret.append(self.l.pop()) self.length-=k return ret pin=INPUT().stream def main(): L,N=pin(2) W=pin(0) W.sort() cnt=0 now=0 for i in W: now+=i cnt+=1 if now>L: print(cnt-1) return elif now==L: print(cnt) return print(cnt) return main()