結果
| 問題 |
No.1219 Mancala Combo
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-11-16 23:16:44 |
| 言語 | Lua (LuaJit 2.1.1734355927) |
| 結果 |
AC
|
| 実行時間 | 49 ms / 2,000 ms |
| コード長 | 315 bytes |
| コンパイル時間 | 213 ms |
| コンパイル使用メモリ | 6,940 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-23 01:48:51 |
| 合計ジャッジ時間 | 2,007 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 26 |
ソースコード
local mfl, mce = math.floor, math.ceil
local n = io.read("*n")
local a = {}
for i = 1, n do
a[i] = io.read("*n")
end
local sum = 0
for i = n, 1, -1 do
if i < a[i] then print("No") os.exit() end
if (a[i] + sum) % i ~= 0 then
print("No") os.exit()
end
sum = sum + mfl((a[i] + sum) / i)
end
print("Yes")