Submission #1792807
Source Code Expand
#include <bits/stdc++.h> #define rep(n) for(lint I = 0; (I) < (lint)(n); ++(I)) #define repeat(i, n) for(lint i = 0; (i) < (lint)(n); ++(i)) #define repeat_to(i, n) for(lint i = 0; (i) <= (lint)(n); ++(i)) #define repeat_from(i, m, n) for(lint i = (m); (i) < (lint)(n); ++(i)) #define repeat_from_to(i, m, n) for(lint i = (m); (i) <= (lint)(n); ++(i)) #define repeat_reverse_from_to(i, m, n) for(lint i = (m); (i) >= (lint)(n); --(i)) #define el cout<<endl #define dump(x) cout<<" "<<#x<<"="<<x #define vdump(v) for(size_t I=0; I<v.size(); ++I){cout<<" "<<#v<<"["<<I<<"]="<<v[I];} cout<<endl using namespace std; using lint = long long; using ld = long double; int main(void) { int n; cin >> n; vector<int> a(1e5 + 20, 0); repeat(i, n) { int t; cin >> t; ++a[t]; ++a[t+1]; ++a[t+2]; } sort(a.begin(), a.end(), greater<int>()); cout << a[0] << endl; }
Submission Info
Submission Time | |
---|---|
Task | C - Together |
User | maphylageo |
Language | C++14 (GCC 5.4.1) |
Score | 300 |
Code Size | 946 Byte |
Status | AC |
Exec Time | 32 ms |
Memory | 640 KB |
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 | 3 ms | 640 KB |
0_001.txt | AC | 3 ms | 640 KB |
0_002.txt | AC | 3 ms | 640 KB |
1_003.txt | AC | 3 ms | 640 KB |
1_004.txt | AC | 18 ms | 640 KB |
1_005.txt | AC | 30 ms | 640 KB |
1_006.txt | AC | 30 ms | 640 KB |
1_007.txt | AC | 30 ms | 640 KB |
1_008.txt | AC | 32 ms | 640 KB |