結果
問題 | No.717 ファッションへのこだわり |
ユーザー | 1644吉田英陽 |
提出日時 | 2020-11-03 22:06:32 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 52 ms / 2,000 ms |
コード長 | 1,359 bytes |
コンパイル時間 | 1,995 ms |
コンパイル使用メモリ | 106,548 KB |
実行使用メモリ | 22,880 KB |
最終ジャッジ日時 | 2023-09-29 15:02:04 |
合計ジャッジ時間 | 3,643 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge11 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 49 ms
18,736 KB |
testcase_01 | AC | 47 ms
22,880 KB |
testcase_02 | AC | 49 ms
20,736 KB |
testcase_03 | AC | 48 ms
18,708 KB |
testcase_04 | AC | 48 ms
20,732 KB |
testcase_05 | AC | 48 ms
20,732 KB |
testcase_06 | AC | 52 ms
20,832 KB |
testcase_07 | AC | 50 ms
20,728 KB |
testcase_08 | AC | 52 ms
22,748 KB |
testcase_09 | AC | 52 ms
20,768 KB |
testcase_10 | AC | 51 ms
20,824 KB |
testcase_11 | AC | 51 ms
20,728 KB |
testcase_12 | AC | 49 ms
20,700 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.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleApp95 { class Program { static void Main(string[] args) { string[] str = Console.ReadLine().Split(); int n = int.Parse(str[0]); int m = int.Parse(str[1]); string s = (Console.ReadLine()); string t = (Console.ReadLine()); int sa = 0; int sb = 0; int ta = 0; int tb = 0; for(int i = 0; i < n; i++) { if (s[i].ToString() == "A") { sa += 1; } else if (s[i].ToString() == "B") { sb += 1; } } for(int i = 0; i < m; i++) { if (t[i].ToString() == "A") { ta += 1; } else if(t[i].ToString()=="B") { tb += 1; } } if (sa > ta) { sa = ta; } if (sb > tb) { sb = tb; } Console.WriteLine(sa + sb); Console.ReadLine(); } } }