Please sign in first.
Submission #47669542
Source Code Expand
#include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;
void solve()
{
int n, m, k, sum = 0; string s;
cin >> n >> m >> k >> s;
for (int i = 0, len = s.length(), j = 0; i < len; i++)
if (i == len - 1 || s[i] == s[i + 1]) sum += (i - j + 1) / 2, j = i + 1;
puts(sum <= k ? "Yes" : "No");
}
int main()
{
int T; cin >> T;
while (T--) solve();
return 0;
}
Submission Info
| Submission Time | |
|---|---|
| Task | B - Unique XOR Path |
| User | liangbowen |
| Language | C++ 20 (gcc 12.2) |
| Score | 700 |
| Code Size | 399 Byte |
| Status | AC |
| Exec Time | 1 ms |
| Memory | 3700 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 700 / 700 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | 00-sample-001.txt |
| All | 00-sample-001.txt, 01-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 |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 00-sample-001.txt | AC | 1 ms | 3560 KiB |
| 01-001.txt | AC | 1 ms | 3580 KiB |
| 01-002.txt | AC | 1 ms | 3552 KiB |
| 01-003.txt | AC | 1 ms | 3632 KiB |
| 01-004.txt | AC | 1 ms | 3584 KiB |
| 01-005.txt | AC | 1 ms | 3560 KiB |
| 01-006.txt | AC | 1 ms | 3560 KiB |
| 01-007.txt | AC | 1 ms | 3492 KiB |
| 01-008.txt | AC | 1 ms | 3468 KiB |
| 01-009.txt | AC | 1 ms | 3660 KiB |
| 01-010.txt | AC | 1 ms | 3496 KiB |
| 01-011.txt | AC | 1 ms | 3564 KiB |
| 01-012.txt | AC | 1 ms | 3508 KiB |
| 01-013.txt | AC | 1 ms | 3440 KiB |
| 01-014.txt | AC | 1 ms | 3436 KiB |
| 01-015.txt | AC | 1 ms | 3508 KiB |
| 01-016.txt | AC | 1 ms | 3700 KiB |
| 01-017.txt | AC | 1 ms | 3508 KiB |
| 01-018.txt | AC | 1 ms | 3564 KiB |
| 01-019.txt | AC | 1 ms | 3564 KiB |
| 01-020.txt | AC | 1 ms | 3508 KiB |
| 01-021.txt | AC | 1 ms | 3464 KiB |