# UVa 10474 - Where is the Marble? --- # 題目大意 給n個數,共q筆詢問,每次詢問輸出某數在從小到大排好的n個數中市第幾個,若同一數有很多個則輸出低一個的位置,若不在這n數中則輸出Not Found --- # 題解 水題 --- ```=C++ #include <bits/stdc++.h> #define ll long long #define pb push_back #define ft first #define sec second #define pr pair<int,int> #define ISCC ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); using namespace std; int t ,n ,m ,cas; vector<int> a; int main() { while(cin >> n >> m && n) { a.clear(); for(int i=0 ,b ;i<n ;i++) cin >> b ,a.pb(b); sort(a.begin() ,a.end()); printf("CASE# %d:\n",++cas); for(int i=0 ,b ;i<m ;i++) { cin >> b; auto ans = find(a.begin() ,a.end() ,b); if(ans == a.end()) printf("%d not found\n",b); else printf("%d found at %d\n",b,ans-a.begin()+1); } } return 0; } ```