結果

問題 No.495 (^^*) Easy
ユーザー CroweaCrowea
提出日時 2019-01-24 11:28:26
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 68 ms / 2,000 ms
コード長 748 bytes
コンパイル時間 837 ms
コンパイル使用メモリ 68,040 KB
実行使用メモリ 23,420 KB
最終ジャッジ日時 2023-10-14 09:36:42
合計ジャッジ時間 2,029 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 56 ms
21,444 KB
testcase_01 AC 56 ms
21,416 KB
testcase_02 AC 55 ms
21,364 KB
testcase_03 AC 57 ms
23,420 KB
testcase_04 AC 57 ms
23,388 KB
testcase_05 AC 64 ms
21,704 KB
testcase_06 AC 68 ms
22,272 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

using System;
using System.Collections.Generic;
using System.Linq;
    class Program
    {
        const string LEFT = "(^^*)";
        const string RIGHT = "(*^^)";
        const string SHARP = "#";

        static void Main(string[] args)
        {
            var line = Console.ReadLine();
            line = line.Replace(LEFT, "L").Replace(RIGHT, "R");
            int leftCnt = 0;
            int rightCnt = 0;
            if (line[0].ToString() == SHARP) Console.WriteLine("{0} {1}", leftCnt, rightCnt);
            else 
            {
                leftCnt  = line.Count (x => x == 'L');
                rightCnt = line.Count (x => x == 'R');
                Console.WriteLine("{0} {1}", leftCnt, rightCnt);
            }
        }
    }
0