結果

問題 No.35 タイパー高橋
ユーザー mustonmuston
提出日時 2016-05-18 14:54:20
言語 Java21
(openjdk 21)
結果
AC  
実行時間 246 ms / 5,000 ms
コード長 856 bytes
コンパイル時間 2,454 ms
コンパイル使用メモリ 76,416 KB
実行使用メモリ 43,440 KB
最終ジャッジ日時 2024-04-15 22:53:59
合計ジャッジ時間 4,035 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 235 ms
43,272 KB
testcase_01 AC 238 ms
43,376 KB
testcase_02 AC 246 ms
43,440 KB
testcase_03 AC 244 ms
43,400 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;
import java.util.*;
/*yukicoder No.35 タイパー高橋*/
class No35{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    int n=scan.nextInt();  //区関数nを入力
    int sumWrite=0;  //打った文字数の合計
    int notWrite=0;  //打てなかった文字数の合計
    for(int i=0;i<n;i++){
      int t =scan.nextInt();  //秒数tを入力
      String s = scan.next();  //文字sを入力
      int write = 12*t/1000;  //t秒で打てる文字数
      //打った文字数の合計を出す
      if(s.length()<write){
        sumWrite += s.length();
        }
      else{
        sumWrite += write;
        //打てなかった文字数の合計を出す
        notWrite += s.length()-write;
      }
    }
    System.out.print(sumWrite + " ");
    System.out.println(notWrite);
  }
}
0