結果
| 問題 |
No.241 出席番号(1)
|
| コンテスト | |
| ユーザー |
sue_charo
|
| 提出日時 | 2017-06-04 00:43:14 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 1,056 bytes |
| コンパイル時間 | 194 ms |
| コンパイル使用メモリ | 12,800 KB |
| 実行使用メモリ | 18,592 KB |
| 最終ジャッジ日時 | 2024-09-22 04:40:20 |
| 合計ジャッジ時間 | 4,753 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 TLE * 1 -- * 1 |
| other | AC * 10 -- * 19 |
ソースコード
# 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()
sue_charo