結果

問題 No.2734 Addition and Multiplication in yukicoder (Hard)
ユーザー GGanariGGanari
提出日時 2024-04-19 23:24:09
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 612 bytes
コンパイル時間 218 ms
コンパイル使用メモリ 81,920 KB
実行使用メモリ 142,440 KB
最終ジャッジ日時 2024-04-19 23:24:24
合計ジャッジ時間 9,203 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
51,840 KB
testcase_01 AC 42 ms
52,096 KB
testcase_02 AC 38 ms
51,840 KB
testcase_03 AC 39 ms
51,840 KB
testcase_04 AC 38 ms
51,712 KB
testcase_05 AC 39 ms
51,840 KB
testcase_06 AC 40 ms
51,840 KB
testcase_07 AC 40 ms
51,968 KB
testcase_08 AC 36 ms
51,840 KB
testcase_09 AC 46 ms
51,712 KB
testcase_10 AC 36 ms
52,096 KB
testcase_11 AC 36 ms
51,712 KB
testcase_12 AC 36 ms
51,840 KB
testcase_13 AC 35 ms
52,096 KB
testcase_14 AC 36 ms
51,840 KB
testcase_15 AC 35 ms
52,352 KB
testcase_16 AC 49 ms
52,096 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 37 ms
58,368 KB
testcase_20 AC 36 ms
58,240 KB
testcase_21 AC 36 ms
58,496 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 386 ms
139,200 KB
testcase_28 AC 386 ms
136,896 KB
testcase_29 AC 383 ms
135,976 KB
testcase_30 AC 371 ms
136,948 KB
testcase_31 AC 362 ms
136,096 KB
testcase_32 AC 371 ms
130,760 KB
testcase_33 AC 327 ms
124,780 KB
testcase_34 AC 307 ms
127,116 KB
testcase_35 AC 206 ms
108,592 KB
testcase_36 AC 228 ms
111,776 KB
testcase_37 AC 285 ms
122,284 KB
testcase_38 AC 305 ms
121,396 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = input()
num = input().split()
num.sort(reverse=True)
index = 9
result = []

max2 = 0
for i in num:
  max2 = max(len(i), max2)

a = []
index = 0
for i in num:
  p = 0
  m = len(i)
  l = 0
  while True:
    if len(i) == max2:
      break
    
    if max2 - m == 1:
        i += str(max(i))
        break
    i += i[p]
    p+= 1
    l += 1
    if p == m:
        p == 0
  a.append([i, index])
  index += 1
a.sort(key=lambda x: (x[0]), reverse=True)
for i in range(len(a)):
  result.append(num[a[i][1]])
res = 0
result.reverse()
for i in result:
    res*= 10**len(i)
    res+=int(i)
    res%=998244353
print(res)
0