結果
| 問題 |
No.8000 enuemu暗号
|
| コンテスト | |
| ユーザー |
14番
|
| 提出日時 | 2016-05-29 17:15:45 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 2,008 bytes |
| コンパイル時間 | 978 ms |
| コンパイル使用メモリ | 112,156 KB |
| 実行使用メモリ | 29,052 KB |
| 最終ジャッジ日時 | 2024-10-07 17:41:25 |
| 合計ジャッジ時間 | 1,684 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | WA * 1 |
コンパイルメッセージ
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.Text;
using System.Linq;
class Program
{
public void Proc()
{
Reader.IsDebug = false;
this.SetDic();
string inpt = Reader.ReadLine();
StringBuilder ans = new StringBuilder();
inpt.ToList().ForEach(a=>ans.Append(dic[a]));
Console.WriteLine(ans.ToString());
}
private Dictionary<char, char> dic = new Dictionary<char, char>();
private void SetDic() {
string src = "pfnovu";
string dec = "orange";
for(int i=0; i<src.Length; i++) {
dic[src[i]] = dec[i];
}
src = "axqwuf";
dec = "cipher";
for(int i=0; i<src.Length; i++) {
dic[src[i]] = dec[i];
}
src = "mbgrihcdejkolsty";
dec = "bqsuftlmdxynzvwj";
for(int i=0; i<src.Length; i++) {
dic[src[i]] = dec[i];
}
string alpha = "abcdefghijklmnopqrstuvwxyz";
List<char> keyList = dic.Keys.ToList();
List<char> valList = dic.Keys.ToList();
List<char> keyFusoku = alpha.Where(a=>!keyList.Contains(a)).ToList();
List<char> valFusoku = alpha.Where(a=>!valList.Contains(a)).ToList();
dic[keyFusoku[0]] = valFusoku[0];
}
public class Reader
{
public static bool IsDebug = true;
private static String PlainInput = @"
mbgrihcdejkolsty
";
private static System.IO.StringReader Sr = null;
public static string ReadLine()
{
if (IsDebug)
{
if (Sr == null)
{
Sr = new System.IO.StringReader(PlainInput.Trim());
}
return Sr.ReadLine();
}
else
{
return Console.ReadLine();
}
}
}
static void Main()
{
Program prg = new Program();
prg.Proc();
}
}
14番