結果
問題 |
No.2958 Placing Many L-s
|
ユーザー |
|
提出日時 | 2024-10-24 20:05:17 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 603 bytes |
コンパイル時間 | 729 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-11-08 20:52:08 |
合計ジャッジ時間 | 7,455 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 2 |
other | WA * 29 |
ソースコード
import re import sys content = input() pattern = r'^(\d+)$' result = re.match(pattern, content) if not result: sys.exit("format error.") T = int(content) if not (1 <= T and T <= 500): sys.exit("T") sum = 0 for t in range(T): content = input() pattern = r'^(\d+) (\d+)$' result = re.match(pattern, content) if not result: sys.exit("format error.") N, M = map(int, content.split()) if not (1 <= N and N <= 500): sys.exit("N") if not (1 <= M and M <= 500): sys.exit("M") sum += N * M if not (sum <= 3 * 10**5): sys.exit("sum")