結果

問題 No.1972 Modulo Set
ユーザー jensenjensen
提出日時 2022-06-28 18:59:49
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 409 bytes
コンパイル時間 146 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 25,480 KB
最終ジャッジ日時 2024-05-01 09:31:56
合計ジャッジ時間 5,797 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
10,880 KB
testcase_01 AC 31 ms
10,752 KB
testcase_02 AC 28 ms
10,752 KB
testcase_03 AC 38 ms
12,624 KB
testcase_04 AC 44 ms
13,664 KB
testcase_05 AC 48 ms
14,420 KB
testcase_06 AC 58 ms
16,660 KB
testcase_07 AC 81 ms
19,876 KB
testcase_08 AC 49 ms
15,244 KB
testcase_09 AC 29 ms
11,008 KB
testcase_10 AC 43 ms
13,900 KB
testcase_11 AC 76 ms
19,400 KB
testcase_12 AC 33 ms
11,904 KB
testcase_13 AC 42 ms
11,520 KB
testcase_14 AC 41 ms
11,648 KB
testcase_15 AC 80 ms
18,856 KB
testcase_16 AC 87 ms
18,740 KB
testcase_17 AC 52 ms
13,584 KB
testcase_18 AC 30 ms
10,752 KB
testcase_19 AC 84 ms
16,988 KB
testcase_20 AC 94 ms
18,596 KB
testcase_21 AC 53 ms
14,320 KB
testcase_22 AC 80 ms
16,028 KB
testcase_23 AC 273 ms
21,584 KB
testcase_24 AC 235 ms
19,204 KB
testcase_25 AC 312 ms
21,100 KB
testcase_26 AC 97 ms
21,612 KB
testcase_27 AC 347 ms
23,192 KB
testcase_28 RE -
testcase_29 RE -
testcase_30 RE -
testcase_31 RE -
testcase_32 RE -
testcase_33 AC 423 ms
25,396 KB
testcase_34 AC 409 ms
25,372 KB
testcase_35 AC 405 ms
25,480 KB
testcase_36 AC 402 ms
25,316 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m=list(map(int,input().split()))
seq=list(map(int,input().split()))
cnt=0
am=[0]*m
for i in range(len(seq)):
    sur=seq[i]%m
    am[sur]+=1
    
if am[0]>0:
    cnt+=1
    
if m%2==0:
    if am[int(m/2)]>0:
        cnt+=1
    for i in range(1,int(len(am)/2)):
        cnt+=max(am[i],am[len(am)-i])
    
else:
    for i in range(1,int(len(am)/2)+1):
        cnt+=max(am[i],am[len(am)-i])
        
print(cnt)
0