結果

問題 No.18 うーさー暗号
ユーザー NoNo
提出日時 2016-06-15 23:23:06
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 49 ms / 5,000 ms
コード長 793 bytes
コンパイル時間 2,181 ms
コンパイル使用メモリ 104,664 KB
実行使用メモリ 22,564 KB
最終ジャッジ日時 2023-09-21 12:20:07
合計ジャッジ時間 3,335 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 48 ms
22,492 KB
testcase_01 AC 49 ms
20,536 KB
testcase_02 AC 48 ms
20,372 KB
testcase_03 AC 47 ms
20,384 KB
testcase_04 AC 48 ms
22,500 KB
testcase_05 AC 47 ms
20,568 KB
testcase_06 AC 48 ms
22,564 KB
testcase_07 AC 47 ms
22,500 KB
testcase_08 AC 47 ms
20,568 KB
testcase_09 AC 48 ms
20,444 KB
testcase_10 AC 48 ms
22,428 KB
testcase_11 AC 49 ms
20,512 KB
testcase_12 AC 49 ms
20,656 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace yukikoda
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = Console.ReadLine();
            string[] c = { "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z" };
            string ans = "";
            for (int i = 1; i <= s.Length; i++)
            {
                int a = Array.IndexOf(c, s[i - 1].ToString());
                int b = a - i;
                while (b < 0)
                {
                    b = b + 26;
                }
                ans += c[b];
            }
            Console.WriteLine(ans);
        }
    }
}
0