Submission #51583083
Source Code Expand
#include <bits/stdc++.h>
using namespace std;
int main() {
int W, B; cin >> W >> B;
int len = W + B;
W -= ((len - 11) / 12) * 7;
B -= ((len - 11) / 12) * 5;
len -= 12 * ((len - 11) / 12);
string s = "wbwbwwbwbwbw";
string s_rev = "wbwbwbwwbwbw";
for (int i = 0; i < len; i++) {
int w_count = 0, b_count = 0;
for (int l = 0; l < i; l++) {
if (s_rev.at(l) == 'w') w_count++; else b_count++;
}
for (int r = 0; r < (len - i); r++) {
if (s.at(r) == 'w') w_count++; else b_count++;
}
if (w_count == W && b_count == B) {
cout << "Yes" << endl;
return 0;
}
}
cout << "No" << endl;
return 0;
}
Submission Info
| Submission Time | |
|---|---|
| Task | B - Piano |
| User | YuTo_QC |
| Language | C++ 20 (gcc 12.2) |
| Score | 0 |
| Code Size | 698 Byte |
| Status | RE |
| Exec Time | 75 ms |
| Memory | 3724 KiB |
Judge Result
| Set Name | Sample | All | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 0 / 200 | ||||||||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt |
| All | 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 01_random_yes_00.txt, 01_random_yes_01.txt, 02_random_yes_2_00.txt, 02_random_yes_2_01.txt, 02_random_yes_2_02.txt, 02_random_yes_2_03.txt, 03_random_no_00.txt, 03_random_no_01.txt, 04_random_no_2_00.txt, 04_random_no_2_01.txt, 04_random_no_2_02.txt, 04_random_no_2_03.txt, 05_handmade_00.txt, 05_handmade_01.txt, 05_handmade_02.txt, 05_handmade_03.txt, 05_handmade_04.txt, 05_handmade_05.txt, 05_handmade_06.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 00_sample_00.txt | AC | 1 ms | 3672 KiB |
| 00_sample_01.txt | AC | 1 ms | 3464 KiB |
| 00_sample_02.txt | RE | 75 ms | 3520 KiB |
| 01_random_yes_00.txt | AC | 1 ms | 3532 KiB |
| 01_random_yes_01.txt | RE | 75 ms | 3584 KiB |
| 02_random_yes_2_00.txt | RE | 74 ms | 3680 KiB |
| 02_random_yes_2_01.txt | RE | 75 ms | 3548 KiB |
| 02_random_yes_2_02.txt | RE | 75 ms | 3544 KiB |
| 02_random_yes_2_03.txt | RE | 75 ms | 3588 KiB |
| 03_random_no_00.txt | AC | 1 ms | 3472 KiB |
| 03_random_no_01.txt | RE | 75 ms | 3688 KiB |
| 04_random_no_2_00.txt | AC | 1 ms | 3472 KiB |
| 04_random_no_2_01.txt | RE | 75 ms | 3724 KiB |
| 04_random_no_2_02.txt | RE | 74 ms | 3688 KiB |
| 04_random_no_2_03.txt | AC | 1 ms | 3488 KiB |
| 05_handmade_00.txt | AC | 1 ms | 3600 KiB |
| 05_handmade_01.txt | WA | 1 ms | 3532 KiB |
| 05_handmade_02.txt | AC | 1 ms | 3672 KiB |
| 05_handmade_03.txt | AC | 1 ms | 3532 KiB |
| 05_handmade_04.txt | RE | 75 ms | 3700 KiB |
| 05_handmade_05.txt | RE | 74 ms | 3528 KiB |
| 05_handmade_06.txt | RE | 74 ms | 3480 KiB |