Submission #33472932


Source Code Expand

N,c = gets.split.map(&:to_i)
Op = [:nop]*30
puts N.times.map{
	t,v = gets.split.map(&:to_i)
	case t
	when 1 # and
		Op.map!.with_index{|op,b|
			0<v[b] ? op : :zero
		}
	when 2 # or
		Op.map!.with_index{|op,b|
			0<v[b] ? :one : op
		}
	when 3 # xor
		Op.map!.with_index{|op,b|
			0<v[b] ? (op==:one ? :zero : op==:zero ? :one : op==:flip ? :nop : :flip) : op
		}
	end
	Op.each_with_index{|op,b|
		case op
		when :zero
			c &= ~(1<<b)
		when :one
			c |= 1<<b
		when :flip
			c ^= 1<<b
		when :nop
		else raise
		end
	}
	next c
}

Submission Info

Submission Time
Task E - Many Operations
User ds14050
Language Ruby (2.7.1)
Score 500
Code Size 562 Byte
Status AC
Exec Time 1410 ms
Memory 16060 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 500 / 500
Status
AC × 2
AC × 23
Set Name Test Cases
Sample sample_01.txt, sample_02.txt
All hand_01.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, random_14.txt, random_15.txt, random_16.txt, random_17.txt, random_18.txt, random_19.txt, random_20.txt, sample_01.txt, sample_02.txt
Case Name Status Exec Time Memory
hand_01.txt AC 63 ms 14188 KiB
random_01.txt AC 1410 ms 15828 KiB
random_02.txt AC 739 ms 15200 KiB
random_03.txt AC 1402 ms 15900 KiB
random_04.txt AC 633 ms 14980 KiB
random_05.txt AC 1401 ms 16000 KiB
random_06.txt AC 521 ms 14892 KiB
random_07.txt AC 1401 ms 15696 KiB
random_08.txt AC 87 ms 14360 KiB
random_09.txt AC 1401 ms 15872 KiB
random_10.txt AC 1198 ms 15868 KiB
random_11.txt AC 1402 ms 15996 KiB
random_12.txt AC 950 ms 15384 KiB
random_13.txt AC 1402 ms 15816 KiB
random_14.txt AC 1345 ms 15900 KiB
random_15.txt AC 1401 ms 15912 KiB
random_16.txt AC 1409 ms 15764 KiB
random_17.txt AC 965 ms 15192 KiB
random_18.txt AC 1397 ms 16060 KiB
random_19.txt AC 576 ms 14964 KiB
random_20.txt AC 1388 ms 16036 KiB
sample_01.txt AC 54 ms 14220 KiB
sample_02.txt AC 55 ms 14124 KiB