結果

問題 No.35 タイパー高橋
ユーザー SagTokiSagToki
提出日時 2018-05-10 16:33:50
言語 Java21
(openjdk 21)
結果
AC  
実行時間 233 ms / 5,000 ms
コード長 1,416 bytes
コンパイル時間 5,804 ms
コンパイル使用メモリ 73,920 KB
実行使用メモリ 59,056 KB
最終ジャッジ日時 2023-09-10 12:07:59
合計ジャッジ時間 6,564 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 222 ms
58,772 KB
testcase_01 AC 225 ms
59,056 KB
testcase_02 AC 233 ms
58,896 KB
testcase_03 AC 228 ms
58,760 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class TyperTakahashi {
    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        try{
            int Section = scanner.nextInt();
            int Success = 0;
            int Failure = 0;
            
            if(Section<1 || Section>1000){
                System.out.println("1~1000の数字で範囲で入力してください");
                System.exit(0);
            }    
            for(int i = 0 ; i < Section ; i++){
                int Time    = scanner.nextInt();
                String Text = scanner.next();
                
                if(Time<1 || Time>30000){
                    System.out.println("1~30000の数字で範囲で入力してください");
                    System.exit(0);
                }         
                if(Text.length() >= 12*Time/1000){
                    Failure += Text.length() - 12*Time/1000;
                    Success += 12*Time/1000;
                }else{
                    Success += Text.length();
                }
            }    
            System.out.print(Success + " ");
            System.out.println(Failure);            
        }catch(InputMismatchException e){
                System.out.println("数字を入力してください");
        }catch(Exception E){
                System.out.println("予期せぬエラー");
        }
        
    }  
}
0