Submission #75815064
Source Code Expand
#J
import sys
input = sys.stdin.readline
T = int(input())
for _ in range(T):
N = int(input())
S = input().strip()
ans = [2]*N
rnd = 1
for i in range(N):
if S[i - 1] == S[(i + 1)%N] or S[(i + 2)%N] == S[(i + 1)%N] or S[i - 1] == S[i - 2]:
ans[i] = rnd
print(*ans)
Submission Info
| Submission Time | |
|---|---|
| Task | J - DETOX |
| User | kkigon |
| Language | Python (PyPy 3.11-v7.3.20) |
| Score | 100 |
| Code Size | 322 Byte |
| Status | AC |
| Exec Time | 290 ms |
| Memory | 118252 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 100 / 100 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | 00-sample-001.txt |
| All | 00-sample-001.txt, 01-002.txt, 01-003.txt, 01-004.txt, 01-005.txt, 01-006.txt, 01-007.txt, 01-008.txt, 01-009.txt, 01-010.txt, 01-011.txt, 01-012.txt, 01-013.txt, 01-014.txt, 01-015.txt, 01-016.txt, 01-017.txt, 01-018.txt, 01-019.txt, 01-020.txt, 01-021.txt, 01-022.txt, 01-023.txt, 01-024.txt, 01-025.txt, 01-026.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 00-sample-001.txt | AC | 50 ms | 79744 KiB |
| 01-002.txt | AC | 290 ms | 111280 KiB |
| 01-003.txt | AC | 244 ms | 110472 KiB |
| 01-004.txt | AC | 244 ms | 110600 KiB |
| 01-005.txt | AC | 243 ms | 110508 KiB |
| 01-006.txt | AC | 244 ms | 110576 KiB |
| 01-007.txt | AC | 246 ms | 110676 KiB |
| 01-008.txt | AC | 237 ms | 111032 KiB |
| 01-009.txt | AC | 234 ms | 110892 KiB |
| 01-010.txt | AC | 236 ms | 110664 KiB |
| 01-011.txt | AC | 239 ms | 110804 KiB |
| 01-012.txt | AC | 233 ms | 111748 KiB |
| 01-013.txt | AC | 238 ms | 118252 KiB |
| 01-014.txt | AC | 231 ms | 117632 KiB |
| 01-015.txt | AC | 239 ms | 118060 KiB |
| 01-016.txt | AC | 234 ms | 117744 KiB |
| 01-017.txt | AC | 238 ms | 117712 KiB |
| 01-018.txt | AC | 232 ms | 117836 KiB |
| 01-019.txt | AC | 235 ms | 117928 KiB |
| 01-020.txt | AC | 243 ms | 118152 KiB |
| 01-021.txt | AC | 235 ms | 118084 KiB |
| 01-022.txt | AC | 235 ms | 117844 KiB |
| 01-023.txt | AC | 238 ms | 117876 KiB |
| 01-024.txt | AC | 239 ms | 117812 KiB |
| 01-025.txt | AC | 232 ms | 118048 KiB |
| 01-026.txt | AC | 256 ms | 112596 KiB |