提出 #6496920
ソースコード 拡げる
import math
# import collections
def main():
N, K = list(map(int, input().split()))
A = list(map(int, input().split()))
dp = {}
memo = set()
L = [0] * N
arrays = {}
values = set()
index = 0
# K = min(K, K % 10 + 10)
for k in range(K):
for a in A:
# print(L, memo)
if a in memo:
index = dp[a]
memo = set(L[:index])
else:
L[index] = a
dp[a] = index
memo.add(a)
index += 1
if index == 0:
s = " "
else:
s = " ".join(map(str,L[:index]))
if s in values:
loop = len(arrays)
# print(loop)
# print(arrays)
print(arrays[(K-1) % loop])
return
else:
arrays[k] = s
values.add(s)
print(*L, sep=" ")
if __name__ == "__main__":
main()
提出情報
| 提出日時 | |
|---|---|
| 問題 | B - Do Not Duplicate |
| ユーザ | suzu6 |
| 言語 | Python (3.4.3) |
| 得点 | 0 |
| コード長 | 1008 Byte |
| 結果 | WA |
| 実行時間 | 2107 ms |
| メモリ | 83644 KiB |
ジャッジ結果
| セット名 | Sample | All | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 得点 / 配点 | 0 / 0 | 0 / 700 | ||||||||||
| 結果 |
|
|
| セット名 | テストケース |
|---|---|
| Sample | sample-01.txt, sample-02.txt, sample-03.txt, sample-04.txt |
| All | 01-01.txt, 01-02.txt, 01-03.txt, 01-04.txt, 01-05.txt, 01-06.txt, 01-07.txt, 01-08.txt, 01-09.txt, 01-10.txt, 01-11.txt, 01-12.txt, 01-13.txt, 01-14.txt, 01-15.txt, 01-16.txt, 01-17.txt, 01-18.txt, 01-19.txt, 01-20.txt, 01-21.txt, 01-22.txt, 01-23.txt, 01-24.txt, 01-25.txt, 01-26.txt, 01-27.txt, 01-28.txt, 01-29.txt, 01-30.txt, sample-01.txt, sample-02.txt, sample-03.txt, sample-04.txt |
| ケース名 | 結果 | 実行時間 | メモリ |
|---|---|---|---|
| 01-01.txt | AC | 17 ms | 3064 KiB |
| 01-02.txt | TLE | 2104 ms | 7716 KiB |
| 01-03.txt | TLE | 2104 ms | 8508 KiB |
| 01-04.txt | TLE | 2104 ms | 21260 KiB |
| 01-05.txt | TLE | 2104 ms | 6964 KiB |
| 01-06.txt | TLE | 2104 ms | 21864 KiB |
| 01-07.txt | TLE | 2104 ms | 19432 KiB |
| 01-08.txt | TLE | 2104 ms | 14456 KiB |
| 01-09.txt | TLE | 2105 ms | 24288 KiB |
| 01-10.txt | TLE | 2105 ms | 26560 KiB |
| 01-11.txt | TLE | 2106 ms | 58292 KiB |
| 01-12.txt | TLE | 2107 ms | 50840 KiB |
| 01-13.txt | TLE | 2107 ms | 67776 KiB |
| 01-14.txt | AC | 98 ms | 14996 KiB |
| 01-15.txt | AC | 199 ms | 24160 KiB |
| 01-16.txt | TLE | 2104 ms | 24576 KiB |
| 01-17.txt | AC | 1517 ms | 24436 KiB |
| 01-18.txt | TLE | 2104 ms | 24448 KiB |
| 01-19.txt | TLE | 2104 ms | 26060 KiB |
| 01-20.txt | TLE | 2104 ms | 25672 KiB |
| 01-21.txt | TLE | 2104 ms | 26056 KiB |
| 01-22.txt | TLE | 2105 ms | 25764 KiB |
| 01-23.txt | TLE | 2105 ms | 25660 KiB |
| 01-24.txt | TLE | 2105 ms | 25636 KiB |
| 01-25.txt | TLE | 2107 ms | 83640 KiB |
| 01-26.txt | TLE | 2107 ms | 83640 KiB |
| 01-27.txt | TLE | 2107 ms | 83644 KiB |
| 01-28.txt | AC | 165 ms | 24692 KiB |
| 01-29.txt | AC | 229 ms | 24692 KiB |
| 01-30.txt | AC | 245 ms | 53548 KiB |
| sample-01.txt | WA | 17 ms | 3064 KiB |
| sample-02.txt | AC | 17 ms | 3064 KiB |
| sample-03.txt | AC | 17 ms | 3064 KiB |
| sample-04.txt | AC | 17 ms | 3064 KiB |