Advertisement
Guest User

Untitled

a guest
Apr 21st, 2019
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. typedef long long ll;
  4. const int sz = 300100;
  5.  
  6. int main()
  7. {
  8. ios_base::sync_with_stdio(false);
  9. cin.tie(nullptr);
  10. cout.tie(nullptr);
  11. int n;
  12. cin>>n;
  13. int a[n];
  14. int tmp, q, one, two;
  15. for (int i = 1; i < n+1; i++)
  16. {
  17. cin>>tmp;
  18. a[tmp] = i;
  19. }
  20. cin>>q;
  21. while (q--)
  22. {
  23. cin>>one>>two;
  24. if (a[one]<a[two])
  25. cout<<"First"<<endl;
  26. else
  27. cout<<"Second"<<endl;
  28. }
  29. return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement