結果
問題 |
No.2734 Addition and Multiplication in yukicoder (Hard)
|
ユーザー |
|
提出日時 | 2024-04-20 09:18:42 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 689 bytes |
コンパイル時間 | 442 ms |
コンパイル使用メモリ | 81,792 KB |
実行使用メモリ | 113,792 KB |
最終ジャッジ日時 | 2024-10-12 04:43:57 |
合計ジャッジ時間 | 8,016 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 1 WA * 35 |
ソースコード
import typing import sys from collections import defaultdict, deque import heapq from functools import cmp_to_key input = lambda: sys.stdin.readline().strip() inf = 10**18 mod = 998244353 # import pypyjit # pypyjit.set_param('max_unroll_recursion=-1') # sys.setrecursionlimit(10**6) def solve(): def cmp(x, y): if len(x) > len(y): return 1 if len(x) < len(y): return -1 if int(x) < int(y): return -1 if int(x) > int(y): return 1 return 0 N = int(input()) l = input().split() l.sort() ans = 0 for x in l: ans = pow(10, len(x))*ans + int(x) ans %= mod print(ans) def main(): t = 1 for _ in range(t): solve() main()