結果
| 問題 | No.501 穴と文字列 |
| コンテスト | |
| ユーザー |
masakt
|
| 提出日時 | 2017-04-07 23:37:38 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 27 ms / 2,000 ms |
| コード長 | 754 bytes |
| コンパイル時間 | 928 ms |
| コンパイル使用メモリ | 112,424 KB |
| 実行使用メモリ | 26,260 KB |
| 最終ジャッジ日時 | 2024-12-14 16:27:32 |
| 合計ジャッジ時間 | 2,265 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 22 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
class P
{
static void Main(string[] _)
{
_ = Console.ReadLine().Split(' ');
int N = int.Parse(_[0]);
int D = int.Parse(_[1]);
int b = D - N;
int c = N - D;
StringBuilder r = new StringBuilder();
for (int i = 0; i < N; i++)
{
r.Append("A");
}
if (b > 0)
{
for (int i = N - 1; i >= N - b; i--)
{
r[i] = 'B';
}
}
else if (c > 0)
{
for (int i = N - 1; i >= N - c; i--)
{
r[i] = 'C';
}
}
Console.WriteLine(r);
}
}
masakt