Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- #define ll long long
- #define vi vector<int>
- #define vll vector<long long int>
- int main()
- {
- #ifndef ONLINE_JUDGE
- freopen("in.txt", "r", stdin);
- freopen("out.txt", "w", stdout);
- #endif
- std::ios::sync_with_stdio(false);
- int t;
- cin >> t;
- while (t--)
- {
- ll n, k, pos = 0;
- cin >> n >> k;
- ll a[n];
- for (ll i = 0; i < n; i++)
- cin >> a[i];
- for (ll i = 0; i < n; i++)
- {
- if (a[i] == k)
- {
- pos = i + 1;
- break;
- }
- }
- if (pos == 0)
- cout << "not found" << endl;
- else
- cout << pos << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement