| Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|---|
| 441305 | 徐嘉豪 | [ 2020年绍兴市第十八届少儿信息学竞赛复赛 ] - 好朋友friend | C++ | 通过 | 100 | 2 MS | 240 KB | 329 | 2026-05-19 17:56:53 |
#include<bits/stdc++.h> using namespace std; int main(){ int n,x,m,d=1; int s[105]; cin>>n>>x>>m; for(int i=1;i<=n;i++){ cin>>s[i]; } while(1){ if(x-d>=1&&s[x-d]!=0&&s[x-d]<=m){ cout<<d*10; return 0; } if(x+d<=n&&s[x+d]!=0&&s[x+d]<=m){ cout<<d*10; return 0; }d++; } return 0; }