Submission #1530449
Source Code Expand
// AtCoder My Practice // author: Leonardone @ NEETSDKASU import std.stdio : readln, writeln; import std.string : chomp; import std.conv : to; void main() { auto n = readln.chomp.to!uint; auto s1 = readln.chomp; auto s2 = readln.chomp; long ans, md = 1_000_000_007; uint i, pat; if (s1[0] == s2[0]) { ans = 3; i = 1; pat = 0; } else { ans = 6; i = 2; pat = 1; } while (i < n) { if (s1[i] == s2[i]) { ans = (ans * 2) % md; pat = 0; i += 1; } else { if (pat == 1) { ans = (ans * 3) % md; } pat = 1; i += 2; } } writeln(ans); }
Submission Info
Submission Time | |
---|---|
Task | D - Coloring Dominoes |
User | neetsdkasu |
Language | D (DMD64 v2.070.1) |
Score | 0 |
Code Size | 791 Byte |
Status | WA |
Exec Time | 1 ms |
Memory | 256 KB |
Judge Result
Set Name | Sample | All | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 400 | ||||||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample1.txt, sample2.txt, sample3.txt |
All | 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 | AC | 1 ms | 256 KB |
10.txt | WA | 1 ms | 256 KB |
11.txt | AC | 1 ms | 256 KB |
12.txt | AC | 1 ms | 256 KB |
13.txt | WA | 1 ms | 256 KB |
14.txt | WA | 1 ms | 256 KB |
15.txt | WA | 1 ms | 256 KB |
16.txt | AC | 1 ms | 256 KB |
17.txt | AC | 1 ms | 256 KB |
18.txt | WA | 1 ms | 256 KB |
19.txt | WA | 1 ms | 256 KB |
2.txt | AC | 1 ms | 256 KB |
20.txt | WA | 1 ms | 256 KB |
21.txt | WA | 1 ms | 256 KB |
22.txt | WA | 1 ms | 256 KB |
3.txt | AC | 1 ms | 256 KB |
4.txt | AC | 1 ms | 256 KB |
5.txt | WA | 1 ms | 256 KB |
6.txt | AC | 1 ms | 256 KB |
7.txt | AC | 1 ms | 256 KB |
8.txt | AC | 1 ms | 256 KB |
9.txt | WA | 1 ms | 256 KB |
sample1.txt | WA | 1 ms | 256 KB |
sample2.txt | AC | 1 ms | 256 KB |
sample3.txt | AC | 1 ms | 256 KB |