fork(1) download
  1. #include <iostream>
  2. #include <string>
  3. #include <vector>
  4. using namespace std;
  5.  
  6. bool relative(const string& s1, const string& s2)
  7. {
  8. vector<bool> v1(256,false), v2(256,false);
  9. for(auto c: s1) v1[c] = true;
  10. for(auto c: s2) v2[c] = true;
  11. return v1 == v2;
  12. }
  13.  
  14. int main() {
  15. cout << relative("baran","baraban") << endl;
  16. cout << relative("baran","baranka") << endl;
  17. return 0;
  18. }
Success #stdin #stdout 0s 15232KB
stdin
Standard input is empty
stdout
1
0