結果

問題 No.169 何分かかるの!?
ユーザー tsunabittsunabit
提出日時 2018-05-09 15:12:09
言語 Java21
(openjdk 21)
結果
AC  
実行時間 136 ms / 1,000 ms
コード長 3,042 bytes
コンパイル時間 3,124 ms
コンパイル使用メモリ 72,572 KB
実行使用メモリ 56,544 KB
最終ジャッジ日時 2023-09-10 11:20:36
合計ジャッジ時間 7,854 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 134 ms
55,968 KB
testcase_01 AC 134 ms
55,936 KB
testcase_02 AC 134 ms
55,920 KB
testcase_03 AC 134 ms
56,108 KB
testcase_04 AC 134 ms
55,944 KB
testcase_05 AC 134 ms
56,176 KB
testcase_06 AC 134 ms
56,360 KB
testcase_07 AC 133 ms
54,072 KB
testcase_08 AC 134 ms
55,732 KB
testcase_09 AC 134 ms
55,968 KB
testcase_10 AC 134 ms
55,880 KB
testcase_11 AC 134 ms
55,840 KB
testcase_12 AC 135 ms
56,284 KB
testcase_13 AC 135 ms
56,544 KB
testcase_14 AC 134 ms
55,864 KB
testcase_15 AC 136 ms
56,120 KB
testcase_16 AC 133 ms
55,820 KB
testcase_17 AC 134 ms
56,240 KB
testcase_18 AC 135 ms
56,232 KB
testcase_19 AC 134 ms
56,088 KB
testcase_20 AC 134 ms
56,184 KB
testcase_21 AC 134 ms
55,688 KB
testcase_22 AC 133 ms
56,080 KB
testcase_23 AC 133 ms
56,008 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
import java.util.stream.Stream;
import java.util.Arrays;

// ***問題文***
// ゆきこちゃんは、大きなサイズのファイルをコピーをしようとしています。
// コピーに時間がかかるので、しばらくして確認すると
// 「K%完了しました。あとS分かかります。」
// と表示されていました。
// ゆきこちゃんは、このファイルコピーに全体で何分かかるか知りたくなりましたが、
// 算数が苦手なので、計算することができません。
// あなたは、ゆきこちゃんの代わりに全体の処理時間(分)を計算してあげてください。
// 答えは、小数部分の切り捨てをし、整数部分のみを答えてください。
// 時間あたりのコピーの速さは、一定であると仮定する。
// ゆきこちゃんの見た完了のパーセンテージは小数も表示されるが、ちょうど整数になっていたタイミングであると仮定して良い。
// ***入力***
// K
// S
// 入力はすべて整数で与えられる。
// 1≤K≤99
// 1≤S≤1000000=106
// Kは%表記であることに注意
// ***出力***
// 処理にかかる時間を答えてください。
// ただし、小数部分を切り捨てた整数部分のみを答えてください。
// 最後に改行してください。

public class No169 {
    public static void main(String[] args) {
        // 標準入力から読み込む際に、Scannerオブジェクトを使う。
        Scanner sc = new Scanner(System.in);
        // int n = sc.nextInt();
        // int m = sc.nextInt();
        double k = sc.nextDouble();
        double s = sc.nextDouble();
        // 2行目をnextLineで読み込むため、数値もnextLineで読み込む
        // int n = Integer.parseInt(sc.nextLine());
        // 新しいstreamを作成し、各要素をintに変換
        // int[] x = Stream.of(sc.nextLine().split(" " , 0)).mapToInt(Integer::parseInt).toArray();
        // int f = Integer.parseInt(sc.next().replace(".", ""));
        // int s = Integer.parseInt(sc.next().replace(".", ""));
        // int[] nm = Stream.of(sc.nextLine().split(" " , 0)).mapToInt(Integer::parseInt).toArray();
        // int[] c = Stream.of(sc.nextLine().split(" " , 0)).mapToInt(Integer::parseInt).toArray();
        // 配列をsort
        // Arrays.sort(c);
        // ------------------------------------------------------------
        // System.out.println(Integer.parseInt((s / (100-k)) * 100));
        System.out.println((int)((s / (100-k)) * 100));
        // ------------------------------------------------------------
        // System.out.println("n = " + f);
        // System.out.println("n = " + s);
        // System.out.println("n = " + fa.length);
        // for(int i = 0; i < f.length; i++) {
        //     System.out.println("[" + i + "] = " + f[i]);
        // }
        // for(int a: x) {
        //     System.out.println("x = " + x);
        // }
    }
}
0