結果

問題 No.35 タイパー高橋
ユーザー chiho_miyakochiho_miyako
提出日時 2015-04-07 21:24:07
言語 Java21
(openjdk 21)
結果
AC  
実行時間 253 ms / 5,000 ms
コード長 725 bytes
コンパイル時間 3,849 ms
コンパイル使用メモリ 74,360 KB
実行使用メモリ 61,328 KB
最終ジャッジ日時 2023-09-17 15:58:32
合計ジャッジ時間 3,847 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 247 ms
61,328 KB
testcase_01 AC 244 ms
60,400 KB
testcase_02 AC 252 ms
60,920 KB
testcase_03 AC 253 ms
61,116 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner koko = new Scanner(System.in);
        int n = koko.nextInt();
        int[] t = new int[n];
        String[] s = new String[n];
        int[] c = new int[n];
        int can = 0;
        int cannot = 0;
        for(int i=0; i<n; i++){
            t[i]=koko.nextInt();
            s[i]=koko.next();
            c[i]=(int)Math.floor(t[i]*12/1000);
            if(c[i]>=s[i].length()){
                can=can+s[i].length();
            }else{
                can=can+c[i];
                cannot=cannot+s[i].length()-c[i];
            }
        }
        System.out.println(can+" "+cannot);
        
    }
}
0