結果

問題 No.2221 Set X
ユーザー とりゐとりゐ
提出日時 2023-02-17 23:06:39
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 441 bytes
コンパイル時間 276 ms
コンパイル使用メモリ 86,976 KB
実行使用メモリ 91,436 KB
最終ジャッジ日時 2023-09-26 20:28:11
合計ジャッジ時間 42,730 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
75,544 KB
testcase_01 AC 72 ms
75,644 KB
testcase_02 AC 71 ms
75,568 KB
testcase_03 AC 72 ms
75,696 KB
testcase_04 AC 74 ms
75,264 KB
testcase_05 AC 68 ms
71,368 KB
testcase_06 AC 73 ms
75,548 KB
testcase_07 AC 74 ms
75,308 KB
testcase_08 AC 82 ms
75,492 KB
testcase_09 AC 73 ms
75,412 KB
testcase_10 AC 80 ms
75,536 KB
testcase_11 AC 77 ms
75,448 KB
testcase_12 AC 79 ms
75,580 KB
testcase_13 AC 79 ms
75,936 KB
testcase_14 AC 86 ms
75,452 KB
testcase_15 AC 80 ms
75,536 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 670 ms
82,400 KB
testcase_22 AC 897 ms
85,740 KB
testcase_23 AC 123 ms
76,240 KB
testcase_24 AC 627 ms
82,060 KB
testcase_25 AC 418 ms
78,968 KB
testcase_26 AC 1,975 ms
89,876 KB
testcase_27 AC 1,971 ms
91,020 KB
testcase_28 WA -
testcase_29 AC 1,975 ms
91,008 KB
testcase_30 AC 1,893 ms
91,068 KB
testcase_31 AC 1,967 ms
91,008 KB
testcase_32 AC 1,975 ms
90,968 KB
testcase_33 AC 1,742 ms
91,064 KB
testcase_34 AC 1,806 ms
91,160 KB
testcase_35 AC 1,876 ms
91,036 KB
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

def solve(a):
  ans=10**9
  ans2=-1
  kouho=set()
  n=len(a)
  for i in range(1,800):
    kouho.add(i)
    if n>=i:
      kouho.add(n//i)
  kouho=sorted(list(kouho))
  for x in kouho:
    last=-1
    cnt=0
    for i in a:
      if i//x!=last:
        cnt+=1
        last=i//x
    if ans>cnt*(x+1):
      ans=cnt*(x+1)
      ans2=x
  return ans,ans2

n=int(input())
a=list(map(int,input().split()))
ans1,ans2=solve(a)

print(ans2)
print(ans1)
0