Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
127136 柯昊阳 折半查找法 C++ 通过 100 1 MS 324 KB 261 2024-01-25 08:01:14

Tests(10/10):


#include <bits/stdc++.h> using namespace std; int t[10005]; int main(){ int n; cin>>n; for(int i = 1;i<=n;i++){ int x; cin>>x; if(t[x]==0) t[x] = i; } int m; cin>>m; if(t[m]==0) cout<<"-1"<<endl; else cout<<t[m]<<endl; return 0; }


测评信息: