Skip to content

Instantly share code, notes, and snippets.

@c650
Created July 9, 2018 23:59
Show Gist options
  • Save c650/605ddb492eecb9d9407396169f2d53c8 to your computer and use it in GitHub Desktop.
Save c650/605ddb492eecb9d9407396169f2d53c8 to your computer and use it in GitHub Desktop.
#!/bin/env ruby
CASES = 25
PRODUCE_DATA = false
STDERR.puts "gif program ?"
program = gets.chomp
`g++ --std=c++17 -Wall -O2 -o #{program}.out #{program}.cpp`
for i in 1..CASES
idx = i.to_s.rjust(2, "0")
if PRODUCE_DATA
`./#{program}.out < judge/#{program}#{idx}.in > judge/#{program}#{idx}.out`
else
`./#{program}.out < judge/#{program}#{idx}.in > judge/2#{program}#{idx}.out`
puts `diff -wq judge/2#{program}#{idx}.out judge/#{program}#{idx}.out`
`rm judge/2#{program}#{idx}.out`
end
end
`rm ./#{program}.out`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment