Submission #1229514
Source Code Expand
require 'prime' include Math def max(a,b); a > b ? a : b end def min(a,b); a < b ? a : b end def swap(a,b); a, b = b, a end def gif; gets.to_i end def gff; gets.to_f end def gsf; gets.chomp end def gi; gets.split.map(&:to_i) end def gf; gets.split.map(&:to_f) end def gs; gets.chomp.split.map(&:to_s) end def gc; gets.chomp.split('') end def pr(num); num.prime_division end def digit(num); num.to_s.length end def array(s,ini=nil); Array.new(s){ini} end def darray(s1,s2,ini=nil); Array.new(s1){Array.new(s2){ini}} end def rep(num); num.times {|i|yield(i)} end def repl(st,en,n=1); n*= -1 if st>en;st.step(en,n){|i|yield(i)} end num = gc data = [] data << num[0] repl 1, num.size-1 do |i| cu = [] data.each do |d| cu << d + '+'+ num[i] cu << d + num[i] end data = cu.dup end ans = 0 data.each do |d| eval "ans+=#{d}" end puts ans
Submission Info
Submission Time | |
---|---|
Task | C - Many Formulas |
User | hayabusa104 |
Language | Ruby (2.3.3) |
Score | 0 |
Code Size | 1463 Byte |
Status | RE |
Exec Time | 18 ms |
Memory | 2684 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 300 | ||||
Status | AC |
|
Set Name | Test Cases |
---|---|
Sample | |
All | 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, sample_01.txt, sample_02.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
01.txt | AC | 18 ms | 2684 KB |
02.txt | AC | 16 ms | 2556 KB |
03.txt | AC | 16 ms | 2556 KB |
04.txt | RE | 10 ms | 2044 KB |
05.txt | AC | 11 ms | 2044 KB |
06.txt | AC | 11 ms | 2044 KB |
07.txt | AC | 16 ms | 2556 KB |
08.txt | AC | 16 ms | 2556 KB |
09.txt | AC | 10 ms | 2044 KB |
10.txt | AC | 10 ms | 2044 KB |
sample_01.txt | AC | 10 ms | 2044 KB |
sample_02.txt | AC | 16 ms | 2556 KB |