Submission #1736623
Source Code Expand
#C問題 together import numpy as np N = int(input()) a = list(map(int,input().split(" "))) a.sort() a2 = np.array(a) minval = a[0] maxval = a[-1] l = (maxval - minval +1) num = [0]*l num_ans = [] num[0] = len(np.where(a2==a[0])) for i in a: if num[i-minval] == 0: num[i-minval] = len(np.where(a2==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 | 577 Byte |
Status | WA |
Exec Time | 2109 ms |
Memory | 23372 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 | WA | 301 ms | 21008 KB |
0_001.txt | AC | 149 ms | 12508 KB |
0_002.txt | AC | 152 ms | 12508 KB |
1_003.txt | AC | 194 ms | 14284 KB |
1_004.txt | WA | 185 ms | 14628 KB |
1_005.txt | WA | 202 ms | 23040 KB |
1_006.txt | WA | 204 ms | 22992 KB |
1_007.txt | WA | 269 ms | 23000 KB |
1_008.txt | TLE | 2109 ms | 23372 KB |