結果
| 問題 | No.2063 ±2^k operations (easy) |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-09-09 12:48:42 |
| 言語 | Lua (LuaJit 2.1.1734355927) |
| 結果 |
AC
|
| 実行時間 | 5 ms / 2,000 ms |
| コード長 | 401 bytes |
| コンパイル時間 | 131 ms |
| コンパイル使用メモリ | 6,824 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-11-25 09:31:47 |
| 合計ジャッジ時間 | 1,053 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 |
ソースコード
local s = io.read() .. "0"
local t = {}
local spos = false
for i = 1, #s do
if s:byte(i) - 48 == 1 then
if not spos then spos = i end
tpos = i
else
if spos then
table.insert(t, tpos - spos + 1)
spos = false
end
end
end
if #t == 1 then
print(1 < t[1] and "Yes" or "No")
elseif #t == 2 then
print((1 == t[1] and 1 == t[2]) and "Yes" or "No")
else
print("No")
end