結果
| 問題 | No.272 NOT回路 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-09-09 17:20:18 |
| 言語 | Ruby (4.0.2) |
| 結果 |
AC
|
| 実行時間 | 84 ms / 1,000 ms |
| コード長 | 415 bytes |
| 記録 | |
| コンパイル時間 | 289 ms |
| コンパイル使用メモリ | 8,960 KB |
| 実行使用メモリ | 14,848 KB |
| 最終ジャッジ日時 | 2026-05-07 18:03:49 |
| 合計ジャッジ時間 | 2,515 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 11 |
コンパイルメッセージ
Syntax OK
ソースコード
class NOTcircuit
attr_reader :x
def initialize(x: 0)
@x = x
end
def cause
begin
@x = Integer(gets.chomp)
rescue
end
end
def not_circuit(value)
(value == 0)? 1 : 0
end
def result
puts not_circuit(@x)
end
def run
cause
result
end
end
if $0 == __FILE__
NOTcircuit.new.run
end