結果

問題 No.18 うーさー暗号
ユーザー takosamatakosama
提出日時 2017-12-16 20:20:26
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 57 ms / 5,000 ms
コード長 924 bytes
コンパイル時間 2,378 ms
コンパイル使用メモリ 108,744 KB
実行使用メモリ 23,620 KB
最終ジャッジ日時 2023-08-21 11:14:14
合計ジャッジ時間 3,942 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 55 ms
21,436 KB
testcase_01 AC 54 ms
23,392 KB
testcase_02 AC 56 ms
21,476 KB
testcase_03 AC 56 ms
23,584 KB
testcase_04 AC 55 ms
21,404 KB
testcase_05 AC 55 ms
21,444 KB
testcase_06 AC 56 ms
21,460 KB
testcase_07 AC 57 ms
23,620 KB
testcase_08 AC 56 ms
21,388 KB
testcase_09 AC 56 ms
21,376 KB
testcase_10 AC 56 ms
21,508 KB
testcase_11 AC 56 ms
23,428 KB
testcase_12 AC 57 ms
23,440 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.IO;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
using Microsoft.SqlServer.Server;

namespace yukicore
{
    class Program
    {
        //no18
        static void Main(string[] args)
        {
            byte[] strs = Console.ReadLine()
                .ToCharArray()
                .Select(x => (byte) x)
                .Select(x => (byte) (x - 65))
                .ToArray();
            var nums = Enumerable.Range(1, strs.Length).ToArray();

            for (int i = 0; i < strs.Length; i++)
            {
                var tmp = (strs[i] - nums[i]) % 26;
                strs[i] = (byte) (tmp < 0 ? 26 + tmp : tmp);
                strs[i] += 65;
            }
            var rtn = new string(strs.Select(x => (char) x).ToArray());
            Console.WriteLine(rtn);
        }



    }
}
0