結果

問題 No.893 お客様を誘導せよ
ユーザー kawap23kawap23
提出日時 2019-09-27 21:34:26
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 141 ms / 2,000 ms
コード長 438 bytes
コンパイル時間 88 ms
コンパイル使用メモリ 11,896 KB
実行使用メモリ 16,696 KB
最終ジャッジ日時 2023-10-25 01:56:48
合計ジャッジ時間 1,643 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
10,160 KB
testcase_01 AC 28 ms
10,160 KB
testcase_02 AC 47 ms
10,996 KB
testcase_03 AC 97 ms
13,352 KB
testcase_04 AC 93 ms
13,348 KB
testcase_05 AC 93 ms
13,064 KB
testcase_06 AC 73 ms
12,148 KB
testcase_07 AC 28 ms
10,160 KB
testcase_08 AC 141 ms
16,696 KB
testcase_09 AC 30 ms
10,420 KB
testcase_10 AC 25 ms
10,164 KB
testcase_11 AC 60 ms
10,272 KB
testcase_12 AC 61 ms
10,444 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
PA = [list(map(int, input().split())) for _ in range(N)]
P = [1] * N

ans = []
ans_append = ans.append
tmp = 0
count = 0
while True:
    if P[tmp] > PA[tmp][0]:
        count += 1
        tmp += 1
        if tmp == N:
            tmp = 0
        if count == N + 1:
            break
        continue
    ans_append(PA[tmp][P[tmp]])
    count = 0
    P[tmp] += 1
    tmp += 1
    if tmp == N:
        tmp = 0

print (*ans)
0