| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 127173 | 刘星辰liuxingchen | 折半查找法 | C++ | Accepted | 100 | 1 MS | 280 KB | 270 | 2024-01-25 08:10:21 |
#include<bits/stdc++.h> using namespace std; int n; int a[10010]; int m; int main() { cin>>n; for(int i=1;i<=n;i++) { cin>>a[i]; } cin>>m; for(int i=1;i<=n;i++) { if(a[i]==m) { cout<<i; return 0; } } cout<<"-1"; return 0; }