Compile Error
foo.cc: In function 'void run_case(int64_t)':
foo.cc:13:25: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'contains'
13 | cout << (s != p && (p.contains('0') ^ p.contains('1')) ? "NO\n" : "YES\n");
| ^~~~~~~~
foo.cc:13:43: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'contains'
13 | cout << (s != p && (p.contains('0') ^ p.contains('1')) ? "NO\n" : "YES\n");
| ^~~~~~~~
Code
#include <bits/stdc++.h>
using namespace std;
#define int int64_t
#define el '\n'
void run_case(int tc) {
int n;
cin >> n;
string s, p;
cin >> s >> p;
cout << (s != p && (p.contains('0') ^ p.contains('1')) ? "NO\n" : "YES\n");
}
int32_t main() {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int _t = 1;
cin >> _t;
for (int i = 1; i <= _t; i++) {
run_case(i);
}
}
Information
- Submit By
- Type
- Submission
- Problem
- P1233 B. Make Binary Strings Equal
- Contest
- Happy New Year 2026
- Language
- C++17 (G++ 13.2.0)
- Submit At
- 2026-01-06 15:47:22
- Judged At
- 2026-01-06 15:47:22
- Judged By
- Score
- 0
- Total Time
- 0ms
- Peak Memory
- 0 Bytes