| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 151982 | 杨金卓 | 18排列骨头 | C++ | Wrong Answer | 1 MS | 272 KB | 383 | 2026-04-19 13:31:39 |
#include<bits/stdc++.h> using namespace std; int main(){ int n,x,b=-1,c=-1; cin>>n; int a[2000]; for(int i=0;i<n;i++){ cin>>a[i]; } cin>>x; for(int i=0;i<n;i++){ if(a[i]==x){ b=i+1; break; } } for(int i=n-1;i>=0;i--){ if(a[i]==x){ c=i+1; break; } } if(c>=0&&b>=0){ cout<<b<<" "<<c; }else{ cout<<"-1"; } return 0; }
------Input------
0
------Answer-----
1 2 3 4 10 11 13 14 15 17 20 21 25 28 29
------Your output-----
-1