結果

問題 No.2729 Addition and Multiplication in yukicoder (Easy)
ユーザー 👑 obakyan
提出日時 2025-07-03 23:03:06
言語 Lua
(LuaJit 2.1.1734355927)
結果
AC  
実行時間 523 ms / 2,000 ms
コード長 431 bytes
コンパイル時間 368 ms
コンパイル使用メモリ 8,356 KB
実行使用メモリ 21,392 KB
最終ジャッジ日時 2025-07-03 23:03:16
合計ジャッジ時間 8,575 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

local ffi = require("ffi")
local C = ffi.C
ffi.cdef[[
long long atoll(const char*);
]]

local function lltonumber(str)
  return C.atoll(str)
end

local mod = 998244353

local n = io.read("*n", "*l")
local str = io.read()
local t = {}
for w in str:gmatch("%d+") do
  table.insert(t, lltonumber(w))
end
table.sort(t)
local ans = 0LL
for i = 1, n do
  ans = (ans * 10LL + t[i]) % mod
end
ans = tostring(ans):gsub("LL", "")
print(ans)
0