結果

問題 No.1198 お菓子配り-1
ユーザー erbowl
提出日時 2021-01-11 12:48:02
言語 Ruby
(3.4.1)
結果
AC  
実行時間 97 ms / 2,000 ms
コード長 116 bytes
コンパイル時間 472 ms
コンパイル使用メモリ 7,424 KB
実行使用メモリ 12,288 KB
最終ジャッジ日時 2024-11-21 09:00:52
合計ジャッジ時間 2,722 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 14
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:3: warning: ambiguous first argument; put parentheses or a space even after `-' operator
Main.rb:10: warning: ambiguous first argument; put parentheses or a space even after `-' operator
Syntax OK

ソースコード

diff #

n = gets.to_i
if n <= 4 && n!=3
    puts -1
    return
end

if n%4==0 || n%2==1
    puts 1
else
    puts -1
end
    
0