結果
| 問題 | No.18 うーさー暗号 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-11-28 16:10:55 |
| 言語 | C# (.NET 10.0.201) |
| 結果 |
AC
|
| 実行時間 | 69 ms / 5,000 ms |
| + 47µs | |
| コード長 | 1,079 bytes |
| 記録 | |
| コンパイル時間 | 5,294 ms |
| コンパイル使用メモリ | 170,320 KB |
| 実行使用メモリ | 191,184 KB |
| 最終ジャッジ日時 | 2026-07-17 00:22:55 |
| 合計ジャッジ時間 | 6,434 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 13 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.csproj を復元しました (101 ミリ秒)。 main -> /home/judge/data/code/bin/Release/net10.0/main.dll main -> /home/judge/data/code/bin/Release/net10.0/publish/
ソースコード
using System;
using System.Diagnostics;
public class Program
{
public static void Main()
{
//int turn = int.Parse(Console.ReadLine() ?? string.Empty);
//string[] num = (Console.ReadLine() ?? string.Empty).Trim().Split(' ');
string str = Console.ReadLine() ?? string.Empty;
string alph = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
string change = "";
for(int i = 0; i < str.Length; i++)
{
int index = alph.IndexOf(str[i]);
if(index - (i+1) < 0)
{
int aa = alph.Length + (index - (i + 1));
while (aa < -26)
{
aa = alph.Length + aa;
}
if(aa >= 0)
{
change += alph[aa];
}
else
{
change += alph[alph.Length + aa];
}
}
else
{
change += alph[index - i-1];
}
}
Console.WriteLine(change);
}
}