結果
問題 | No.224 文字列変更(easy) |
ユーザー |
![]() |
提出日時 | 2015-09-12 09:45:27 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 22 ms / 5,000 ms |
コード長 | 1,523 bytes |
コンパイル時間 | 1,311 ms |
コンパイル使用メモリ | 113,372 KB |
実行使用メモリ | 25,816 KB |
最終ジャッジ日時 | 2024-07-18 02:07:17 |
合計ジャッジ時間 | 2,096 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 22 |
コンパイルメッセージ
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; class Program { static string InputPattern = "Input4"; static List<string> GetInputList() { var WillReturn = new List<string>(); if (InputPattern == "Input1") { WillReturn.Add("7"); WillReturn.Add("aaabbcc"); WillReturn.Add("aabbccc"); //2 //まず、3文字目を'a' -> 'b'と変更すると、 //aaabbcc -> aabbbcc //次に、6文字目を'b' -> 'c'と変更すると、 //aabbbcc -> aabbccc } else if (InputPattern == "Input2") { WillReturn.Add("5"); WillReturn.Add("abcde"); WillReturn.Add("abcde"); //0 //操作を行う必要がないため、0を出力します。 } else if (InputPattern == "Input3") { WillReturn.Add("8"); WillReturn.Add("hidamari"); WillReturn.Add("yunocchi"); //7 } else { string wkStr; while ((wkStr = Console.ReadLine()) != null) WillReturn.Add(wkStr); } return WillReturn; } //No.224 文字列変更(easy) static void Main() { List<string> InputList = GetInputList(); string S = InputList[1]; string T = InputList[2]; int Cost = 0; for (int I = 0; I <= S.Length - 1; I++) { if (S[I] != T[I]) Cost++; } Console.WriteLine(Cost); } }