Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
2550 | 邓小龙 | 19买画笔 | C++ | Wrong Answer | 0 MS | 220 KB | 360 | 2024-01-13 16:06:17 |
#include<stdio.h> using namespace std; int main(){ int n; scanf("%d",&n); int a[n]; int i; for(i=0;i<n;i++){ scanf("%d",&a[i]); } int b=a[0],c=a[1]; for(i=1;i<n;i++) { b=a[i-1]; c=a[i]; if(b==a[i+1]){ b=c; } } printf("%d\n",b); return 0; }
------Input------
9 1 1 9 11 5 3 11 5 3
------Answer-----
9
------Your output-----
5