結果
問題 | No.3005 天使のハッシュ関数 |
ユーザー | kuuso1 |
提出日時 | 2014-12-25 23:34:04 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 94 ms / 5,000 ms |
コード長 | 1,760 bytes |
コンパイル時間 | 4,235 ms |
コンパイル使用メモリ | 108,648 KB |
実行使用メモリ | 26,100 KB |
最終ジャッジ日時 | 2023-09-03 18:05:38 |
合計ジャッジ時間 | 6,291 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge13 |
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 87 ms
24,108 KB |
testcase_01 | AC | 85 ms
23,964 KB |
testcase_02 | AC | 85 ms
23,980 KB |
testcase_03 | AC | 86 ms
25,968 KB |
testcase_04 | AC | 90 ms
26,100 KB |
testcase_05 | AC | 94 ms
24,096 KB |
testcase_06 | AC | 86 ms
23,872 KB |
testcase_07 | AC | 86 ms
22,056 KB |
testcase_08 | AC | 88 ms
26,036 KB |
testcase_09 | AC | 89 ms
24,168 KB |
testcase_10 | AC | 87 ms
24,120 KB |
testcase_11 | AC | 87 ms
23,920 KB |
testcase_12 | AC | 86 ms
24,152 KB |
testcase_13 | AC | 86 ms
24,072 KB |
コンパイルメッセージ
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; using System.Collections.Generic; using System.Security.Cryptography; using System.Text; class TEST{ static void Main(){ Sol mySol =new Sol(); mySol.Solve(); } } class Sol{ public void Solve(){ using (MD5 md5Hash = MD5.Create()){ string hash = GetMd5Hash(md5Hash, S); string hash2 = GetMd5Hash(md5Hash, hash); Console.WriteLine(hash2); } } String S; public Sol(){ S=rs(); } static string GetMd5Hash(MD5 md5Hash, string input) { // Convert the input string to a byte array and compute the hash. byte[] data = md5Hash.ComputeHash(Encoding.UTF8.GetBytes(input)); // Create a new Stringbuilder to collect the bytes // and create a string. StringBuilder sBuilder = new StringBuilder(); // Loop through each byte of the hashed data // and format each one as a hexadecimal string. for (int i = 0; i < data.Length; i++) { sBuilder.Append(data[i].ToString("x2")); } // Return the hexadecimal string. return sBuilder.ToString(); } static String rs(){return Console.ReadLine();} static int ri(){return int.Parse(Console.ReadLine());} static long rl(){return long.Parse(Console.ReadLine());} static double rd(){return double.Parse(Console.ReadLine());} static String[] rsa(){return Console.ReadLine().Split(' ');} static int[] ria(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>int.Parse(e));} static long[] rla(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>long.Parse(e));} static double[] rda(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>double.Parse(e));} }