Sha256: 56cb59eac1154f18d6aa406180aaa420048b8cd296882c94c27720376b3cf31b

Contents?: true

Size: 520 Bytes

Versions: 2

Compression:

Stored size: 520 Bytes

Contents

require 'base64'

File.open('stdin.txt.bz2', 'wb') do |file|
  file.write Base64.decode64 $stdin.read
  file.close
end

system('bunzip2 stdin.txt.bz2')

stdin = File.open('stdin.txt').read.split("\n<$><*><$>\n")
code = stdin[0]
input = stdin[1]
time = stdin[2]

File.open('./main.c', 'w') do |file|
  file.puts code
  file.close
end

File.open('./test.in', 'w') do |file|
  file.puts input
  file.close
end

system('/opt/wandbox/gcc-head/bin/gcc main.c -o main -O2')
system('timeout -s 9 ' + time + ' ./main < test.in')

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
judge_system-1.7.4 lib/compile_systems/c_system.rb
judge_system-1.7.3 lib/compile_systems/c_system.rb