Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
121588 欧阳俊懿 22相差2的数的个数 C++ Wrong Answer 1 MS 272 KB 602 2025-06-07 17:12:11

Tests(0/2):


Code:

#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ int n,maxn=0; int f[105]; cin>>n; for(int i=0;i<n;i++) { int num; cin>>f[num]; f[num]++; } for(int i=0;i<=98;i++) { int c=f[i]+f[i+1]+f[i+2]; maxn=max(maxn,c); } maxn=max(maxn,f[99]+f[100]); maxn=max(maxn,f[100]); cout<<maxn<<endl; return 0; }


Run Info:

------Input------
10 80 79 78 77 65 55 54 54 50 49
------Answer-----
3
------Your output-----
1410899306