結果

問題 No.35 タイパー高橋
ユーザー SagTokiSagToki
提出日時 2018-05-10 16:11:32
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 1,388 bytes
コンパイル時間 3,744 ms
コンパイル使用メモリ 71,976 KB
実行使用メモリ 60,880 KB
最終ジャッジ日時 2023-09-10 11:39:39
合計ジャッジ時間 4,973 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
権限があれば一括ダウンロードができます

ソースコード

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("指定の範囲で入力してください");
                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("指定の範囲で入力してください");
                    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.println(Success);
            System.out.println(Failure);            
        }catch(InputMismatchException e){
                System.out.println("数字を入力してください");
        }catch(Exception E){
                System.out.println("予期せぬエラー");
        }
        
    }  
}
0