結果
問題 | No.18 うーさー暗号 |
ユーザー |
![]() |
提出日時 | 2023-11-05 22:49:21 |
言語 | C# (.NET 8.0.404) |
結果 |
AC
|
実行時間 | 48 ms / 5,000 ms |
コード長 | 2,004 bytes |
コンパイル時間 | 8,110 ms |
コンパイル使用メモリ | 166,732 KB |
実行使用メモリ | 183,104 KB |
最終ジャッジ日時 | 2024-09-25 22:50:09 |
合計ジャッジ時間 | 9,778 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 13 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.csproj を復元しました (100 ms)。 MSBuild のバージョン 17.9.6+a4ecab324 (.NET) main -> /home/judge/data/code/bin/Release/net8.0/main.dll main -> /home/judge/data/code/bin/Release/net8.0/publish/
ソースコード
using System;using System.Collections.Generic;public class InputStrorage{public char[] encrypted;}public static class InputHandler{public static void ReadInput(InputStrorage input){string str = Console.ReadLine();input.encrypted = str.ToCharArray();}}namespace GeneralLibs{public class Compare{public static long ReturnMax(long a, long b){if (a > b) return a;else return b;}public static long ReturnMax(long[] a){long max = long.MinValue;for (int i = 0; i < a.Length; i++){if (a[i] > max) max = a[i];}return max;}}public class ShowValues{public static void ShowArray1D(long[] a, string str = "default"){Console.WriteLine(str);for (int i = 0; i < a.Length; i++){Console.Write("{0} ", a[i]);}Console.WriteLine();Console.WriteLine(str);}public static void ShowValue(long a, string str = "default"){Console.WriteLine("{0} : {1}", a, str);}}}public class SpecificLibs{public static char[] DecryptString(char[] input){char[] result = new char[input.Length];for(int i = 0; i < input.Length; i++){int shift = (i + 1) % 26;int code = (int)input[i];code -= shift;if (code < 65){code = 90 - (65 - code - 1);}result[i] = (char)code;}return result;}}static class No18{static void Main(){InputStrorage input = new InputStrorage();InputHandler.ReadInput(input);//A=65, Z = 90;string ans = new string (SpecificLibs.DecryptString(input.encrypted));Console.WriteLine(ans);}}