提出 #525939
ソースコード 拡げる
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ABC029C
{
class Program
{
static void Main(string[] args)
{
int n = int.Parse(Console.ReadLine());
int threePow = (int)Math.Pow(3, n);
var alphabet = new char[] { 'a', 'b', 'c' };
for (int i = 0; i < threePow; i++)
{
int b = i;
var array = new char[n];
for (int j = 0; j < n; j++)
{
array[j] = alphabet[b % 3];
b /= 3;
}
for (int k = n - 1; k >= 0; k--)
Console.Write(array[k]);
Console.WriteLine();
}
}
}
}
提出情報
| 提出日時 | |
|---|---|
| 問題 | C - Brute-force Attack |
| ユーザ | pythagorean |
| 言語 | C# (Mono 3.2.1.0) |
| 得点 | 100 |
| コード長 | 636 Byte |
| 結果 | AC |
| 実行時間 | 288 ms |
| メモリ | 9276 KiB |
ジャッジ結果
| セット名 | Sample | All | ||||
|---|---|---|---|---|---|---|
| 得点 / 配点 | 0 / 0 | 100 / 100 | ||||
| 結果 |
|
|
| セット名 | テストケース |
|---|---|
| Sample | subtask0_sample_01.txt, subtask0_sample_02.txt |
| All | subtask0_sample_01.txt, subtask0_sample_02.txt, subtask1_01.txt, subtask1_02.txt, subtask1_03.txt, subtask1_04.txt, subtask1_05.txt, subtask1_06.txt |
| ケース名 | 結果 | 実行時間 | メモリ |
|---|---|---|---|
| subtask0_sample_01.txt | AC | 121 ms | 8948 KiB |
| subtask0_sample_02.txt | AC | 122 ms | 8880 KiB |
| subtask1_01.txt | AC | 122 ms | 8980 KiB |
| subtask1_02.txt | AC | 122 ms | 8888 KiB |
| subtask1_03.txt | AC | 125 ms | 8940 KiB |
| subtask1_04.txt | AC | 137 ms | 8996 KiB |
| subtask1_05.txt | AC | 197 ms | 9088 KiB |
| subtask1_06.txt | AC | 288 ms | 9276 KiB |