結果

問題 No.35 タイパー高橋
ユーザー kmtrc130kmtrc130
提出日時 2017-04-25 16:03:11
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 57 ms / 5,000 ms
コード長 1,066 bytes
コンパイル時間 1,898 ms
コンパイル使用メモリ 97,968 KB
実行使用メモリ 22,968 KB
最終ジャッジ日時 2023-10-11 09:37:57
合計ジャッジ時間 2,633 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 56 ms
22,856 KB
testcase_01 AC 55 ms
22,724 KB
testcase_02 AC 57 ms
22,784 KB
testcase_03 AC 56 ms
22,968 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
{
    static void Main(string[] args)
    {
        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);
    }
}
0