結果

問題 No.241 出席番号(1)
ユーザー sue_charosue_charo
提出日時 2017-06-04 00:43:14
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 1,056 bytes
コンパイル時間 114 ms
コンパイル使用メモリ 12,100 KB
実行使用メモリ 15,276 KB
最終ジャッジ日時 2023-10-22 03:10:33
合計ジャッジ時間 5,232 ms
ジャッジサーバーID
(参考情報)
judge9 / judge10
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
15,276 KB
testcase_01 AC 37 ms
10,924 KB
testcase_02 AC 38 ms
10,924 KB
testcase_03 AC 39 ms
10,924 KB
testcase_04 AC 37 ms
10,924 KB
testcase_05 AC 38 ms
10,924 KB
testcase_06 AC 39 ms
10,924 KB
testcase_07 AC 38 ms
10,924 KB
testcase_08 AC 38 ms
10,924 KB
testcase_09 AC 38 ms
10,924 KB
testcase_10 AC 38 ms
10,924 KB
testcase_11 TLE -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

# coding: utf-8
import array, bisect, collections, copy, heapq, itertools, math, random, re, string, sys, time
sys.setrecursionlimit(10 ** 7)
INF = 10 ** 20
MOD = 10 ** 9 + 7


def II(): return int(input())
def ILI(): return list(map(int, input().split()))
def IAI(LINE): return [ILI() for __ in range(LINE)]
def IDI(): return {key: value for key, value in ILI()}


def read():
    N = II()
    A = [II() for __ in range(N)]
    return (N, A)


def solve(N, A):
    l_num = list(range(N))
    update = True
    while update:
        update = False
        for i in range(N):
            if i == N - 1:
                if A[i] == l_num[i]:
                    l_num[i], l_num[0] = l_num[0], l_num[i]
                    update = True
            else:
                if A[i] == l_num[i]:
                    l_num[i], l_num[i + 1] = l_num[i + 1], l_num[i]
                    update = True

    ans = l_num
    return ans


def main():
    params = read()
    ans = solve(*params)
    for a in ans:
        print(a)


if __name__ == "__main__":
    main()
0