Submission #50880639
Source Code Expand
IX = lambda{|abc,xyz|
abc.zip(xyz).map{|a,x|
[a.begin,x.begin].max..[a.end,x.end].min
}
}
V = lambda{|abc|
abc.map(&:size).inject:*
}
V1,V2,V3 = gets.split.map(&:to_i)
if V1+2*V2+3*V3!=3*7*7*7
puts 'No'
exit
end
O = 0..6,0..6,0..6
abc = nil,nil,nil
efg = nil,nil,nil
0.upto(7){|a|
abc[0] = a..a+6
0.upto(a){|b|
abc[1] = b..b+6
0.upto(b){|c|
abc[2] = c..c+6
oa = IX[O,abc]
next if V[oa]<V3
if 0<V3
es = a-6..6
fs = b-6..6
gs = c-6..6
else
es = -7..a
fs = -7..b
gs = -7..c
end
es.each{|e|
efg[0] = e..e+6
fs.each{|f|
efg[1] = f..f+6
gs.each{|g|
efg[2] = g..g+6
oae = IX[oa,efg]
v3 = V[oae]
next if v3!=V3
oe = IX[O,efg]
ae = IX[abc,efg]
v2 = V[oa]+V[oe]+V[ae]-3*v3
next if v2!=V2
puts 'Yes',[0,0,0,a,b,c,e,f,g]*' '
exit
}
}
}
}
}
}
puts 'No'
Submission Info
| Submission Time |
|
| Task |
E - 7x7x7 |
| User |
ds14050 |
| Language |
Ruby (ruby 3.2.2) |
| Score |
475 |
| Code Size |
948 Byte |
| Status |
AC |
| Exec Time |
417 ms |
| Memory |
17596 KiB |
Judge Result
| Set Name |
Sample |
All |
| Score / Max Score |
0 / 0 |
475 / 475 |
| Status |
|
|
| Set Name |
Test Cases |
| Sample |
00_sample_00.txt, 00_sample_01.txt |
| All |
00_sample_00.txt, 00_sample_01.txt, 01_random_00.txt, 01_random_01.txt, 01_random_02.txt, 02_random2_00.txt, 02_random2_01.txt, 02_random2_02.txt, 02_random2_03.txt, 02_random2_04.txt, 02_random2_05.txt, 02_random2_06.txt, 02_random2_07.txt, 02_random2_08.txt, 02_random2_09.txt, 03_killer_00.txt, 03_killer_01.txt, 04_killer2_00.txt, 04_killer2_01.txt, 05_handmade_00.txt, 05_handmade_01.txt, 05_handmade_02.txt, 05_handmade_03.txt, 05_handmade_04.txt, 05_handmade_05.txt, 05_handmade_06.txt |
| Case Name |
Status |
Exec Time |
Memory |
| 00_sample_00.txt |
AC |
136 ms |
17392 KiB |
| 00_sample_01.txt |
AC |
44 ms |
17180 KiB |
| 01_random_00.txt |
AC |
44 ms |
17208 KiB |
| 01_random_01.txt |
AC |
44 ms |
17144 KiB |
| 01_random_02.txt |
AC |
44 ms |
17108 KiB |
| 02_random2_00.txt |
AC |
44 ms |
17500 KiB |
| 02_random2_01.txt |
AC |
63 ms |
17596 KiB |
| 02_random2_02.txt |
AC |
48 ms |
17500 KiB |
| 02_random2_03.txt |
AC |
51 ms |
17448 KiB |
| 02_random2_04.txt |
AC |
77 ms |
17520 KiB |
| 02_random2_05.txt |
AC |
57 ms |
17496 KiB |
| 02_random2_06.txt |
AC |
63 ms |
17352 KiB |
| 02_random2_07.txt |
AC |
154 ms |
17540 KiB |
| 02_random2_08.txt |
AC |
98 ms |
17452 KiB |
| 02_random2_09.txt |
AC |
104 ms |
17504 KiB |
| 03_killer_00.txt |
AC |
417 ms |
17420 KiB |
| 03_killer_01.txt |
AC |
412 ms |
17512 KiB |
| 04_killer2_00.txt |
AC |
98 ms |
17556 KiB |
| 04_killer2_01.txt |
AC |
86 ms |
17560 KiB |
| 05_handmade_00.txt |
AC |
43 ms |
17156 KiB |
| 05_handmade_01.txt |
AC |
42 ms |
16840 KiB |
| 05_handmade_02.txt |
AC |
416 ms |
17500 KiB |
| 05_handmade_03.txt |
AC |
415 ms |
17528 KiB |
| 05_handmade_04.txt |
AC |
46 ms |
17448 KiB |
| 05_handmade_05.txt |
AC |
42 ms |
17120 KiB |
| 05_handmade_06.txt |
AC |
45 ms |
17348 KiB |