結果

問題 No.1940 Escape through + -
ユーザー 👑 obakyan
提出日時 2022-05-18 22:33:06
言語 Lua
(LuaJit 2.1.1734355927)
結果
AC  
実行時間 30 ms / 2,000 ms
コード長 405 bytes
コンパイル時間 88 ms
コンパイル使用メモリ 6,812 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-09-17 02:17:55
合計ジャッジ時間 1,275 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

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 n, m, s = io.read():match("(%d+) (%d+) (%d+)")
n = tonumber(n)
m = lltonumber(m)
s = lltonumber(s)
local a = 0LL
for i = 1, n do
  a = a + io.read("*n")
end
if a < s then a, s = s, a end
if (s - a) % m == 0LL then
  print("Yes")
else
  print("No")
end
0