提出 #681842
ソースコード 拡げる
for t in xrange(input()): n = int(input()) c = [list(raw_input()) for i in range(n)] count, i = 0, 0 while len(c) > 1: j = (i+1)%len(c) a = c[j].pop(0) if a in c[i]: c[i].remove(a) else: c[i].append(a) if len(c[j]) == 0: del c[j] if j == 0: i-=1 if len(c[i]) == 0: del c[i] i %= len(c) else: i = (i+1)%len(c) count += 1 if count >= 10000: count = -1 break print count
提出情報
ジャッジ結果
| セット名 | All | ||
|---|---|---|---|
| 得点 / 配点 | 100 / 100 | ||
| 結果 |
|
| セット名 | テストケース |
|---|---|
| All | test_01.txt |
| ケース名 | 結果 | 実行時間 | メモリ |
|---|---|---|---|
| test_01.txt | AC | 544 ms | 3568 KiB |