Advertisement
Asif_Anwar

Timus-1026. Questions and answers

Apr 10th, 2021
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.14 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4. #define pb push_back
  5. #define FastIO ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
  6. #define F first
  7. #define S second
  8. typedef long long ll;
  9. typedef vector< int > vi;
  10. typedef vector< ll > V;
  11. typedef map<int, int > mp;
  12. #define debug cout << -1 << endl;
  13. #define REP(i, a, b) for(int i=a; i<b; i++)
  14. #define f0r(i, n) for (int i = 0; i < n; ++i)
  15. #define fore(a, x) for (auto& a : x)
  16. #define fori(i, a, b) for (int i = (a); i < (b); ++i)
  17. #define pop pop_back
  18. #define sz(a) (int)a.size()
  19. const ll MOD = 1000000007;
  20. const int INF = INT_MAX;
  21. const int maxN = 2001;
  22.  
  23. int dx[] = {-1, 0, 1, -1, 1, -1, 0, 1};
  24. int dy[] = {-1, -1, -1, 0, 0, 1, 1, 1};
  25.  
  26. void solve()
  27. {
  28.     int n;
  29.     cin >> n;
  30.     vi v;
  31.     while(n--) {
  32.         int x; cin >> x;
  33.         v.pb(x);
  34.     }
  35.     sort(v.begin(), v.end());
  36.     string s;
  37.     cin >> s;
  38.     cin >> n;
  39.     while(n--) {
  40.         int x;
  41.         cin >> x;
  42.         cout << v[x-1] << endl;
  43.     }
  44.     return;
  45. }
  46.  
  47. int main()
  48. {
  49.     //FastIO;
  50.     //freopen("mowing.in","r",stdin);
  51.     //freopen("mowing.out","w",stdout);
  52.     int t;
  53.     t = 1;
  54.     //cin >> t;
  55.     //cin.ignore();
  56.     while(t--){
  57.         solve();
  58.     }
  59.     return 0;
  60. }
  61.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement