Method: Codeforces::Viewer::Viewer#show

Defined in:
lib/codeforces/viewer/viewer.rb

#showObject



71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# File 'lib/codeforces/viewer/viewer.rb', line 71

def show()
  contest_id = @option[:contest_id]
  problem_id = @option[:problem_id]


  if @option[:input_only]
    puts fetch_input(@option[:input_only], contest_id, problem_id)
  elsif @option[:output_only]
    puts fetch_output(@option[:output_only], contest_id, problem_id)
  else
    ret = fetch_problem_text contest_id, problem_id
    puts "# #{ret[:round]}"
    puts "URL: #{Codeforces::Viewer::Utils.get_problem_url(contest_id, problem_id)}"
    print ret[:info][:title]
    print ret[:info][:time_limit]
    print ret[:info][:memory_limit]
    print ret[:info][:input_file]
    print ret[:info][:output_file]
    puts ""
    puts ""
    puts "   * * * * *"
    puts ""
    puts ret[:body]
    puts ""
    puts "   * * * * *"
    puts ""
    puts ret[:input]
    puts ret[:output]
    puts ""
    puts "   * * * * *"
    puts ""
    puts ret[:sample_test]
    puts ""
    puts "   * * * * *"
    puts ""
    puts ret[:note]
  end
end