AquaBlitz11

[t105] RNA

Oct 9th, 2018
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.38 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <algorithm>
  3. using namespace std;
  4.  
  5. const int N = 510;
  6. char A[N], B[N];
  7.  
  8. int main()
  9. {
  10.     int n, m;
  11.     scanf("%d %s %s%d", &n, A, B, &m);
  12.     while (m--) {
  13.         int l, r;
  14.         scanf("%d%d", &l, &r);
  15.         for (int i = l; i <= r; ++i)
  16.             swap(A[i-1], B[i-1]);
  17.     }
  18.     printf("%s\n", A);
  19.     printf("%s\n", B);
  20.  
  21.     return 0;
  22. }
Add Comment
Please, Sign In to add comment