結果
問題 | No.18 うーさー暗号 |
ユーザー |
|
提出日時 | 2017-12-16 20:20:26 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 30 ms / 5,000 ms |
コード長 | 924 bytes |
コンパイル時間 | 1,319 ms |
コンパイル使用メモリ | 109,780 KB |
実行使用メモリ | 18,944 KB |
最終ジャッジ日時 | 2024-12-14 21:53:53 |
合計ジャッジ時間 | 2,456 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 13 |
コンパイルメッセージ
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.IO;using System.Linq;using System.Runtime.CompilerServices;using System.Text;using System.Threading.Tasks;using Microsoft.SqlServer.Server;namespace yukicore{class Program{//no18static 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);}}}