Submission #2251942
Source Code Expand
#include <iostream> #include<cstdlib> #include<queue> #include<set> #include<vector> #include<string> #include<algorithm> #include<stack> #include<map> #include<cstdio> using namespace std; #define rep(i,a) for(int i=0;i<a;i++) #define mp make_pair #define pb push_back #define P pair<int,int> #define ll __int64 #define ll long long int n; ll a[111111]; int cnt[111111]; int c1,c2; int main(){ cin>>n; rep(i,n)cin>>a[i]; rep(i,n){ cnt[a[i]+2]++; cnt[a[i]+1]++; cnt[a[i]]++; } int tmp=0,in=0; for(int i=0;i<=111110;i++)if(tmp<cnt[i])tmp=cnt[i],in=i; cout<<tmp<<endl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | C - Together |
User | pappagukun |
Language | C++14 (GCC 5.4.1) |
Score | 300 |
Code Size | 629 Byte |
Status | AC |
Exec Time | 29 ms |
Memory | 1408 KB |
Compile Error
./Main.cpp:17:0: warning: "ll" redefined #define ll long long ^ ./Main.cpp:16:0: note: this is the location of the previous definition #define ll __int64 ^
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 300 / 300 | ||||
Status |
|
|
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 | AC | 17 ms | 1024 KB |
1_005.txt | AC | 29 ms | 1024 KB |
1_006.txt | AC | 29 ms | 1024 KB |
1_007.txt | AC | 29 ms | 1024 KB |
1_008.txt | AC | 29 ms | 1408 KB |