Submission #1736570
Source Code Expand
#C問題 together N = int(input()) a = list(map(int,input().split(" "))) a.sort() minval = a[0] maxval = a[-1] l = (maxval - minval +1) num = [0]*l num_ans = [] num[0] = a.count(minval) for i in a: if num[i-minval] == 0: num[i-minval] = a.count(i) if l == 1: print(num[0]) exit(0) num_ans.append(num[0]+num[1]) if l == 2: print(num_ans[0]) exit(0) for i in range(1,l-1): num_ans.append(num[i-1]+num[i]+num[i+1]) num_ans.append(num[-2]+num[-1]) print(max(num_ans))
Submission Info
Submission Time | |
---|---|
Task | C - Together |
User | banboooo044 |
Language | Python (3.4.3) |
Score | 0 |
Code Size | 519 Byte |
Status | TLE |
Exec Time | 2104 ms |
Memory | 13964 KB |
Judge Result
Set Name | Sample | All | ||||||
---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 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 | 17 ms | 3064 KB |
0_001.txt | AC | 17 ms | 3064 KB |
0_002.txt | AC | 17 ms | 3064 KB |
1_003.txt | AC | 56 ms | 4760 KB |
1_004.txt | AC | 44 ms | 4660 KB |
1_005.txt | AC | 64 ms | 13964 KB |
1_006.txt | AC | 64 ms | 13964 KB |
1_007.txt | AC | 334 ms | 13964 KB |
1_008.txt | TLE | 2104 ms | 13812 KB |