Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
108415 黄思翔 22相差2的数的个数 C++ Wrong Answer 1 MS 272 KB 477 2025-01-20 11:34:32

Tests(0/2):


Code:

# include<bits/stdc++.h> using namespace std; int main(){ int f[105]; int n; cin >> n; for (int i = 0; i < n; i++) { int num; cin >> num; f[num]++; } int maxn = 0; 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-----
1384431911