結果

問題 No.495 (^^*) Easy
ユーザー curryudon08curryudon08
提出日時 2020-06-14 13:22:36
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 68 ms / 2,000 ms
コード長 562 bytes
コンパイル時間 2,112 ms
コンパイル使用メモリ 103,948 KB
実行使用メモリ 21,044 KB
最終ジャッジ日時 2023-09-09 13:12:59
合計ジャッジ時間 3,023 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 56 ms
20,608 KB
testcase_01 AC 55 ms
20,712 KB
testcase_02 AC 54 ms
20,820 KB
testcase_03 AC 55 ms
18,792 KB
testcase_04 AC 56 ms
20,768 KB
testcase_05 AC 64 ms
21,044 KB
testcase_06 AC 68 ms
19,712 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Linq;


namespace _0495
{
    class Program
    {
        static void Main(string[] args)
        {
            var s = Console.ReadLine().Trim();
            var x = s.Replace("^^*","0").Replace("*^^","1");
            

            var a = 0;
            var b = 0;
            foreach(var c in x){
                if(c == '0'){
                    a += 1;
                }else if(c == '1'){
                    b += 1;
                }
            }

            Console.WriteLine(string.Format("{0} {1}",a,b));
        }
    }
}
0