結果

問題 No.796 well known
ユーザー foumifoumi
提出日時 2019-04-06 17:23:28
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 508 bytes
コンパイル時間 91 ms
コンパイル使用メモリ 10,880 KB
実行使用メモリ 19,136 KB
最終ジャッジ日時 2023-09-06 14:36:10
合計ジャッジ時間 4,073 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 20 ms
19,136 KB
testcase_01 AC 19 ms
9,228 KB
testcase_02 AC 18 ms
9,188 KB
testcase_03 AC 18 ms
9,192 KB
testcase_04 TLE -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import random
from functools import reduce
from operator import mul
N = int(input())
l = []
limit = 312456 - N + 1

def random_list():
    for i in range(N):
        l.append(random.randint(0, (limit) - sum(l)))

for x in range(limit**N):
    random_list()
    if 0 in l:
        l = []
        continue
    elif sum(l) % 3 != 1:
        l = []
        continue
    elif reduce(mul, l) % 3 == 0:
        l = list(map(str, l))
        print(' '.join(l))
        break
    else:
        l = []
        continue
0