結果

問題 No.2593 Reorder and Mod 120
ユーザー ButterflvButterflv
提出日時 2023-12-21 11:34:18
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 619 bytes
コンパイル時間 144 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 66,436 KB
最終ジャッジ日時 2023-12-21 11:34:21
合計ジャッジ時間 2,370 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,460 KB
testcase_01 RE -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 34 ms
53,460 KB
testcase_06 WA -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 47 ms
66,436 KB
testcase_25 AC 44 ms
66,436 KB
testcase_26 AC 44 ms
66,436 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
S=str(input())

arr=[0,0,0,0,0,0,0,0,0,0]

for i in range(N):
  arr[int(S[i])]+=1

allN=0

for i in range(10):
  allN+=i*(arr[i]%120)*40
  allN%=120

check=[]

for i in range(10):
  for j in range(10):
  	for k in range(10):
  	  if i==j and j==k and arr[i]<3:
  	  	continue
  	  if (i==j and arr[i]<2) or (j==k and arr[j]<2) or (k==i and arr[k]<2):
  	  	continue
  	  if arr[i]<1 or arr[j]<1 or arr[k]<1:
  	  	continue
  	  check.append((allN -i*1 -j*10 -k*100)%120)

check.sort()

count=1
temp=check[0]

for i in range(1, len(check)):
  if temp!=check[i]:
  	count+=1
  	temp=check[i]

print(count)
0