結果
問題 | No.505 カードの数式2 |
ユーザー | mkawa2 |
提出日時 | 2020-01-03 12:55:34 |
言語 | Python3 (3.11.6 + numpy 1.26.0 + scipy 1.11.3) |
結果 |
MLE
|
実行時間 | - |
コード長 | 1,178 bytes |
コンパイル時間 | 103 ms |
コンパイル使用メモリ | 11,072 KB |
実行使用メモリ | 607,172 KB |
最終ジャッジ日時 | 2023-08-14 19:10:29 |
合計ジャッジ時間 | 10,781 ms |
ジャッジサーバーID (参考情報) |
judge11 / judge14 |
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | MLE | - |
testcase_01 | AC | 129 ms
29,920 KB |
testcase_02 | AC | 151 ms
34,512 KB |
testcase_03 | AC | 129 ms
29,972 KB |
testcase_04 | AC | 126 ms
29,804 KB |
testcase_05 | AC | 126 ms
29,800 KB |
testcase_06 | AC | 128 ms
30,036 KB |
testcase_07 | AC | 128 ms
29,848 KB |
testcase_08 | AC | 126 ms
29,844 KB |
testcase_09 | AC | 127 ms
30,064 KB |
testcase_10 | AC | 126 ms
29,944 KB |
testcase_11 | WA | - |
testcase_12 | AC | 126 ms
29,940 KB |
testcase_13 | WA | - |
testcase_14 | WA | - |
testcase_15 | AC | 126 ms
29,744 KB |
testcase_16 | WA | - |
testcase_17 | WA | - |
testcase_18 | WA | - |
testcase_19 | AC | 128 ms
29,948 KB |
testcase_20 | AC | 125 ms
30,048 KB |
testcase_21 | AC | 122 ms
29,988 KB |
testcase_22 | AC | 591 ms
122,092 KB |
testcase_23 | WA | - |
testcase_24 | WA | - |
testcase_25 | WA | - |
testcase_26 | AC | 899 ms
144,176 KB |
testcase_27 | AC | 903 ms
144,568 KB |
testcase_28 | MLE | - |
testcase_29 | -- | - |
testcase_30 | -- | - |
testcase_31 | -- | - |
ソースコード
from itertools import * from bisect import * # from math import * from collections import * from heapq import * from random import * from decimal import * import numpy as np import sys sys.setrecursionlimit(10 ** 6) int1 = lambda x: int(x) - 1 p2D = lambda x: print(*x, sep="\n") def II(): return int(sys.stdin.readline()) def MI(): return map(int, sys.stdin.readline().split()) def MI1(): return map(int1, sys.stdin.readline().split()) def MF(): return map(float, sys.stdin.readline().split()) def LI(): return list(map(int, sys.stdin.readline().split())) def LI1(): return list(map(int1, sys.stdin.readline().split())) def LF(): return list(map(float, sys.stdin.readline().split())) def LLI(rows_number): return [LI() for _ in range(rows_number)] dij = [(0, 1), (1, 0), (0, -1), (-1, 0)] def main(): def div(a,b): res=abs(a)//abs(b) coff=((a>0)^(b>0))*2-1 return coff*res n=II() aa=LI() now=set() now.add(aa[0]) for a in aa[1:]: nxt=set() for s in now: nxt.add(s+a) nxt.add(s-a) nxt.add(s*a) if a!=0:nxt.add(div(s,a)) now=nxt print(max(now)) main()