Submission #7804248
Source Code Expand
using System;
using static System.Console;
class Program
{
public static void Main()
{
int n = int.Parse(ReadLine());
int M = 1000000007;
int N = 'z' - 'a' + 1;
long[] a = new long[N];
string s = ReadLine();
for (int i = 0; i < n; i++)
{
char c = s[i];
a[c - 'a']++;
}
long x = 1;
for (int i = 0; i < N; i++)
{
if (a[i] > 0)
x = x * (a[i] + 1) % M;
}
x = (x + M - 1) % M;
WriteLine(x);
}
}
Submission Info
| Submission Time | |
|---|---|
| Task | A - Colorful Subsequence |
| User | unnohideyuki |
| Language | C# (Mono 4.6.2.0) |
| Score | 200 |
| Code Size | 469 Byte |
| Status | AC |
| Exec Time | 21 ms |
| Memory | 11232 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 200 / 200 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | sample-01.txt, sample-02.txt, sample-03.txt |
| All | 01-00.txt, 01-01.txt, 01-02.txt, 01-03.txt, 01-04.txt, 01-05.txt, 01-06.txt, 01-07.txt, 01-08.txt, 01-09.txt, sample-01.txt, sample-02.txt, sample-03.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 01-00.txt | AC | 21 ms | 11232 KiB |
| 01-01.txt | AC | 21 ms | 9184 KiB |
| 01-02.txt | AC | 21 ms | 11232 KiB |
| 01-03.txt | AC | 20 ms | 9044 KiB |
| 01-04.txt | AC | 20 ms | 9044 KiB |
| 01-05.txt | AC | 20 ms | 9044 KiB |
| 01-06.txt | AC | 21 ms | 11232 KiB |
| 01-07.txt | AC | 21 ms | 11232 KiB |
| 01-08.txt | AC | 21 ms | 11232 KiB |
| 01-09.txt | AC | 21 ms | 11232 KiB |
| sample-01.txt | AC | 20 ms | 11092 KiB |
| sample-02.txt | AC | 20 ms | 11092 KiB |
| sample-03.txt | AC | 20 ms | 9044 KiB |