Submission #1557451


Source Code Expand

#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define mp make_pair
#define gc getchar
#define pb push_back
#define eb emplace_back
#define all(x) (x).begin(),(x).end()
#define x1 uvuvwevwevwe
#define y1 onyetenyevwe
#define x2 ugwemubwem
#define y2 ossas
typedef long long LL;
typedef long double LD;
typedef pair<int,int> pii;
template <typename T> void scan(T &angka){
	angka=0;char input=gc();T kali=1;
	while(!(48<=input&&input<=57)){	if(input=='-')	kali=-1;input=gc();}
	while(48<=input&&input<=57)	angka=(angka<<3)+(angka<<1)+input-48,input=gc();angka*=kali;
}
template <typename T1,typename T2> void scan(T1 &angka1,T2 &angka2){
	scan(angka1);scan(angka2);
}
int n,arr[100005],occ[100005]={},ans=0;
int main()
{
	scan(n);
	for(int i=1;i<=n;i++)
		scan(arr[i]),occ[arr[i]]++;
	for(int i=3;i<=100000;i++)
		ans=max(ans,occ[i-2]+occ[i-1]+occ[i]);
	cout<<ans<<endl;
}

Submission Info

Submission Time
Task C - Together
User Yehezkiel
Language C++14 (GCC 5.4.1)
Score 0
Code Size 938 Byte
Status WA
Exec Time 6 ms
Memory 1024 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 300
Status
AC × 3
AC × 8
WA × 1
Set Name Test Cases
Sample 0_000.txt, 0_001.txt, 0_002.txt
All 0_000.txt, 0_001.txt, 0_002.txt, 1_003.txt, 1_004.txt, 1_005.txt, 1_006.txt, 1_007.txt, 1_008.txt
Case Name Status Exec Time Memory
0_000.txt AC 1 ms 256 KB
0_001.txt AC 1 ms 256 KB
0_002.txt AC 1 ms 256 KB
1_003.txt AC 1 ms 256 KB
1_004.txt WA 3 ms 640 KB
1_005.txt AC 6 ms 640 KB
1_006.txt AC 6 ms 640 KB
1_007.txt AC 6 ms 640 KB
1_008.txt AC 6 ms 1024 KB