Submission #75816861
Source Code Expand
#pragma GCC optimize("Ofast,unroll-loops")
#include <bits/stdc++.h>
#define int long long
using namespace std;
string S;
int T, N;
signed main() {
cin.tie(0)->sync_with_stdio(0);
cin >> T;
while (T--) {
cin >> N >> S;
S = S + S;
for (int i = 0; i < N; i++) {
if (S[i + 1] == S[i + 2] || S[N + i - 1] == S[N + i - 2] || S[i + 1] == S[N + i - 1]) {
cout << "1 ";
}
else {
cout << "2 ";
}
}
cout << '\n';
}
return 0;
}
Submission Info
| Submission Time | |
|---|---|
| Task | J - DETOX |
| User | fortunatly |
| Language | C++23 (GCC 15.2.0) |
| Score | 100 |
| Code Size | 489 Byte |
| Status | AC |
| Exec Time | 15 ms |
| Memory | 3864 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 | 15 ms | 3424 KiB |
| 01-002.txt | AC | 13 ms | 3452 KiB |
| 01-003.txt | AC | 8 ms | 3428 KiB |
| 01-004.txt | AC | 8 ms | 3492 KiB |
| 01-005.txt | AC | 8 ms | 3432 KiB |
| 01-006.txt | AC | 8 ms | 3432 KiB |
| 01-007.txt | AC | 8 ms | 3472 KiB |
| 01-008.txt | AC | 7 ms | 3676 KiB |
| 01-009.txt | AC | 7 ms | 3672 KiB |
| 01-010.txt | AC | 7 ms | 3632 KiB |
| 01-011.txt | AC | 7 ms | 3540 KiB |
| 01-012.txt | AC | 7 ms | 3588 KiB |
| 01-013.txt | AC | 7 ms | 3788 KiB |
| 01-014.txt | AC | 7 ms | 3864 KiB |
| 01-015.txt | AC | 7 ms | 3736 KiB |
| 01-016.txt | AC | 7 ms | 3820 KiB |
| 01-017.txt | AC | 7 ms | 3860 KiB |
| 01-018.txt | AC | 7 ms | 3668 KiB |
| 01-019.txt | AC | 7 ms | 3772 KiB |
| 01-020.txt | AC | 7 ms | 3792 KiB |
| 01-021.txt | AC | 7 ms | 3776 KiB |
| 01-022.txt | AC | 7 ms | 3860 KiB |
| 01-023.txt | AC | 7 ms | 3760 KiB |
| 01-024.txt | AC | 7 ms | 3732 KiB |
| 01-025.txt | AC | 7 ms | 3668 KiB |
| 01-026.txt | AC | 10 ms | 3796 KiB |