結果

問題 No.35 タイパー高橋
ユーザー kmtrc130kmtrc130
提出日時 2019-03-18 15:15:49
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 61 ms / 5,000 ms
コード長 1,150 bytes
コンパイル時間 3,975 ms
コンパイル使用メモリ 103,568 KB
実行使用メモリ 20,824 KB
最終ジャッジ日時 2023-09-25 12:18:25
合計ジャッジ時間 2,966 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 61 ms
20,744 KB
testcase_01 AC 61 ms
20,824 KB
testcase_02 AC 60 ms
20,788 KB
testcase_03 AC 60 ms
20,788 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;

class Program
{
    public void Solve()
    {
        int N = int.Parse(Console.ReadLine());

        int possible = 0;
        int success = 0;
        int successCnt = 0;
        int missCnt = 0;

        string[] TS;

        for (int i = 0; i < N; i++)
        {
            TS = Console.ReadLine().Split(' ');

            possible = 12 * int.Parse(TS[0]) / 1000;

            if (TS[1].Length < possible)
            {
                successCnt += TS[1].Length;
            }
            else
            {
                if (possible == TS[1].Length)
                {
                    successCnt += possible;
                    continue;
                }

                if (possible < TS[1].Length) { success = possible; }
                else { success = (possible - TS[1].Length < 0 ? 0 : possible - TS[1].Length); }

                missCnt += TS[1].Length - possible;
                successCnt += success;
            }
        }

        Console.WriteLine("{0} {1}", successCnt, missCnt);
    }

    static void Main()
    {
        var solver = new Program();
        solver.Solve();
    }
}
0