Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Example program
- #include <iostream>
- #include <vector>
- using namespace std;
- int main()
- {
- int k;
- cin >> k;
- int lengths[k];
- int totalLength = 2;
- int startingIndex[k];
- startingIndex[0] = 2;
- for(int i = 0; i < k; ++i)
- {
- cin >> lengths[i];
- totalLength += lengths[i];
- if(i!=0) startingIndex[i] = startingIndex[i-1] + lengths[i-1];
- }
- for(int i = 0; i < k; ++i)
- {
- cout << "Starting index dla " << (char)(i+97) << ": " << startingIndex[i] << endl;
- }
- int l,r,leftLength = 0,rightLength = 0;
- cin >> l;
- char leftSide[l];
- for(int i = 0; i < l; ++i)
- {
- cin >> leftSide[i];
- if(leftSide[i] == '0' || leftSide[i] == '1')
- ++leftLength;
- else
- leftLength += lengths[(int)leftSide[i] - 97];
- }
- cin >> r;
- char rightSide[r];
- for(int i = 0; i < r; ++i)
- {
- cin >> rightSide[i];
- if(rightSide[i] == '0' || rightSide[i] == '1')
- ++rightLength;
- else
- rightLength += lengths[(int)rightSide[i] - 97];
- }
- cout << leftLength << " " << rightLength;
- short leftSideExpanded[leftLength];
- short rightSideExpanded[leftLength];
- for(int j = 0; j < l; ++j)
- {
- for(int x = 0; x < lengths[(int)leftSide[j] - 97]; ++x)
- {
- leftSideExpanded[x] = (int)leftSide[j] - 97;
- }
- }
- if(leftLength != rightLength)
- {
- cout << 0;
- return 0;
- }
- vector<vector<int>> graph(totalLength);
- for(int i = 0; i < leftLength; ++i)
- {
- // porownojemy i'ta pozycje z lewego z i'ta z prawego
- int lK = (int)leftSide[i] - 97, rK = (int)leftSide[i] - 97;
- if(leftSide[i] == '1' || rightSide[i] == '1')
- {
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement