daily pastebin goal
82%
SHARE
TWEET

Untitled

a guest May 16th, 2018 102 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. queue<pair<long long , long long>> queueizpair;
  2.         pair<long long ,long long > help=make_pair(0,0);
  3.         queueizpair.push(help);
  4.         while (!queueizpair.empty()) {
  5.             long long checkfirst = queueizpair.front().first, checksecond = queueizpair.front().second;
  6.             queueizpair.pop();
  7.             if (transition_first[checkfirst] != transition_second[checksecond]) {
  8.                 ans = false;
  9.                 break;
  10.             }
  11.             for (auto i = 0; i < 'z' - 'a' + 1; i++) { // по всем буковкам
  12.                 long long cur1 = firstAutomat[checkfirst][i];
  13.                 long long cur2 = secondAutomat[checksecond][i];
  14.                 if ((!path_first[cur1] || !path_second[cur2])&&(cur1!=n||cur2!=n2))
  15.                     queueizpair.push(make_pair(cur1, cur2));
  16.                  if(cur1!=n) path_first[cur1] = true;
  17.                 if(cur2!=n2)path_second[cur2] = true;
  18.             }
RAW Paste Data
Top