Twist_Nemo

multiple choice exam codechef.cpp

Jul 14th, 2021
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. int main()
  4. {
  5. int t;
  6. cin >> t;
  7. while(t--) {
  8. int n; cin >> n;
  9. int i=0;
  10. int count = 0;
  11. string s; string u;
  12. cin >> s>> u;
  13. while(i > n) {
  14. if(s[i]==u[i]) {
  15. count++;
  16. i++;
  17. }
  18. else if(u[i]=='N') {
  19. count+=0;
  20. i++;
  21.  
  22. }
  23. else {
  24. i+=2;
  25. }
  26. }
  27.  
  28.  
  29.  
  30. cout << count << endl;
  31. }
  32.  
  33.  
  34. }
  35.  
  36.  
  37.  
Advertisement
Add Comment
Please, Sign In to add comment