結果
問題 | No.2959 Dolls' Tea Party |
ユーザー |
|
提出日時 | 2024-10-28 23:49:30 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 659 bytes |
コンパイル時間 | 187 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 112,508 KB |
最終ジャッジ日時 | 2024-10-29 00:13:10 |
合計ジャッジ時間 | 9,696 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 4 |
other | WA * 33 |
ソースコード
import reimport syscontent = input()pattern = r'^(\d+) (\d+)$'result = re.match(pattern, content)if not result:sys.exit("format error.")N, K = map(int, content.split())if not (1 <= N and N <= 3*10**5):sys.exit("N")if not (2 <= K and K <= 1300):sys.exit("K")content = input()pattern = r'^(-?\d+)( (-?\d+))*$'result = re.match(pattern, content)if not result:sys.exit("format error.")A = list(map(int, content.split()))if len(A) != N:sys.exit("A")sum = 0for i in range(N):if not (1 <= A[i] and A[i] <= 998244352):sys.exit("A[i]")sum += A[i]if not (K <= sum):sys.exit("sum")