結果
| 問題 |
No.1665 quotient replace
|
| コンテスト | |
| ユーザー |
👑 |
| 提出日時 | 2022-01-09 00:23:08 |
| 言語 | Lua (LuaJit 2.1.1734355927) |
| 結果 |
TLE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 605 bytes |
| コンパイル時間 | 60 ms |
| コンパイル使用メモリ | 6,948 KB |
| 実行使用メモリ | 172,496 KB |
| 最終ジャッジ日時 | 2024-11-14 10:04:25 |
| 合計ジャッジ時間 | 112,478 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 37 TLE * 4 |
ソースコード
local bxor = bit.bxor
local mce, mfl, msq, mmi, mma, mab = math.ceil, math.floor, math.sqrt, math.min, math.max, math.abs
local m = {}
local lim = 1000 * 1000
for i = 1, lim do
m[i] = {}
end
local tt = {0}
for i = 2, lim do
local mi = m[i]
for j = 1, lim do
if not mi[j] then tt[i] = j break end
end
local v = tt[i]
for j = i + i, lim, i do
m[j][v] = true
end
end
-- print(os.clock())
-- os.exit()
local n = io.read("*n", "*l")
local ret = 0
local s = io.read()
for w in s:gmatch("%d+") do
local a = tonumber(w)
ret = bxor(ret, tt[a])
end
print(ret == 0 and "black" or "white")