結果

問題 No.18 うーさー暗号
ユーザー TaK7907TaK7907
提出日時 2017-10-25 00:58:29
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 52 ms / 5,000 ms
コード長 1,436 bytes
コンパイル時間 4,378 ms
コンパイル使用メモリ 105,464 KB
実行使用メモリ 22,924 KB
最終ジャッジ日時 2023-09-21 12:52:33
合計ジャッジ時間 4,259 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 50 ms
20,700 KB
testcase_01 AC 50 ms
20,768 KB
testcase_02 AC 50 ms
22,760 KB
testcase_03 AC 52 ms
20,648 KB
testcase_04 AC 51 ms
20,648 KB
testcase_05 AC 52 ms
22,924 KB
testcase_06 AC 51 ms
22,700 KB
testcase_07 AC 51 ms
18,632 KB
testcase_08 AC 52 ms
22,748 KB
testcase_09 AC 52 ms
22,656 KB
testcase_10 AC 52 ms
20,680 KB
testcase_11 AC 52 ms
20,656 KB
testcase_12 AC 51 ms
22,692 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;

namespace yukicode {
    public class Program {
        public static string Solver(System.IO.TextReader reader) {
            const string alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
            var s = reader.ReadLine();
            var sb = new System.Text.StringBuilder();
            for (var i = 1; i <= s.Length; ++i) {
                var p = alphabet.IndexOf( s[ i -1] )+1;
                var q = ( p > i % 26 ? 0 : 26 ) + p - i % 26-1;
                sb.Append( alphabet[ q ] );
            }
            return sb.ToString();
        }

        private static void Main() {
            Console.WriteLine( Solver( Console.In ) );
        }
    }

    public class MyLib {
        public static string Ordinalization(int num) {
            string surfix = "stndrdth";
            return string.Format( "{0}{1}", num,
                ( 0 < num % 10 && num % 10 <= 4 ) && ( ( num % 100 ) / 10 != 1 ) ?
                surfix.Substring( ( num % 10 - 1 ) * 2, 2 ) : surfix.Substring( 6 ) );
        }
        public static List<int> GetIntList(string input, char delimitor) {
            return input.Split( delimitor ).ToList<string>().ConvertAll<int>( int.Parse );
        }
        public static List<int> GetIntList(string input, char[] delimitors) {
            return input.Split( delimitors ).ToList<string>().ConvertAll<int>( int.Parse );
        }
    }
}
0