Submission #1532505


Source Code Expand

Copy
gets;s=3;gets.chop.gsub(/(.)\1/,?.).chars.chunk{|c|c>?.}.map{|k,v|n=v.size-1;s*=k ?2**n: 2*3**n};p s%(10**9+7)

Submission Info

Submission Time
Task D - Coloring Dominoes
User leafmoon
Language Ruby (2.3.3)
Score 400
Code Size 110 Byte
Status
Exec Time 7 ms
Memory 1788 KB

Test Cases

Set Name Score / Max Score Test Cases
Sample 0 / 0 sample1.txt, sample2.txt, sample3.txt
All 400 / 400 sample1.txt, sample2.txt, sample3.txt, 1.txt, 10.txt, 11.txt, 12.txt, 13.txt, 14.txt, 15.txt, 16.txt, 17.txt, 18.txt, 19.txt, 2.txt, 20.txt, 21.txt, 22.txt, 3.txt, 4.txt, 5.txt, 6.txt, 7.txt, 8.txt, 9.txt, sample1.txt, sample2.txt, sample3.txt
Case Name Status Exec Time Memory
1.txt 7 ms 1788 KB
10.txt 7 ms 1788 KB
11.txt 6 ms 1788 KB
12.txt 7 ms 1788 KB
13.txt 6 ms 1788 KB
14.txt 6 ms 1788 KB
15.txt 7 ms 1788 KB
16.txt 6 ms 1788 KB
17.txt 6 ms 1788 KB
18.txt 6 ms 1788 KB
19.txt 7 ms 1788 KB
2.txt 6 ms 1788 KB
20.txt 6 ms 1788 KB
21.txt 6 ms 1788 KB
22.txt 6 ms 1788 KB
3.txt 6 ms 1788 KB
4.txt 6 ms 1788 KB
5.txt 6 ms 1788 KB
6.txt 6 ms 1788 KB
7.txt 7 ms 1788 KB
8.txt 6 ms 1788 KB
9.txt 7 ms 1788 KB
sample1.txt 6 ms 1788 KB
sample2.txt 7 ms 1788 KB
sample3.txt 6 ms 1788 KB