結果

問題 No.35 タイパー高橋
ユーザー yun_appyun_app
提出日時 2016-05-09 21:29:48
言語 Java21
(openjdk 21)
結果
AC  
実行時間 160 ms / 5,000 ms
コード長 884 bytes
コンパイル時間 2,426 ms
コンパイル使用メモリ 75,504 KB
実行使用メモリ 54,260 KB
最終ジャッジ日時 2024-04-15 14:57:56
合計ジャッジ時間 3,512 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 154 ms
54,168 KB
testcase_01 AC 152 ms
54,156 KB
testcase_02 AC 160 ms
53,964 KB
testcase_03 AC 158 ms
54,260 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
    public static void main (String[] args) throws java.lang.Exception
    {
        // your code goes here
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        int a=0;
        int b=0;
        for(int i=0;i<n;i++){
            String[] lines = br.readLine().split(" ");
            int can_w  = Integer.parseInt(lines[0])*12/1000;
            int length = lines[1].length();
            if(length<=can_w){
                a += length;
            }else{
                a += can_w;
                b += length-can_w;
            }
        }
        
        System.out.println(a + " " + b);
    }
}
0