結果

問題 No.1453 手助け
ユーザー jun612jun612
提出日時 2021-04-01 15:21:48
言語 Java21
(openjdk 21)
結果
AC  
実行時間 127 ms / 2,000 ms
コード長 896 bytes
コンパイル時間 3,755 ms
コンパイル使用メモリ 71,872 KB
実行使用メモリ 56,144 KB
最終ジャッジ日時 2023-08-22 18:27:36
合計ジャッジ時間 7,495 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
55,888 KB
testcase_01 AC 125 ms
56,032 KB
testcase_02 AC 126 ms
56,144 KB
testcase_03 AC 125 ms
55,588 KB
testcase_04 AC 125 ms
53,992 KB
testcase_05 AC 127 ms
55,596 KB
testcase_06 AC 126 ms
55,512 KB
testcase_07 AC 126 ms
55,612 KB
testcase_08 AC 126 ms
55,756 KB
testcase_09 AC 126 ms
56,016 KB
testcase_10 AC 127 ms
55,924 KB
testcase_11 AC 126 ms
55,772 KB
testcase_12 AC 125 ms
55,992 KB
testcase_13 AC 125 ms
55,800 KB
testcase_14 AC 124 ms
55,564 KB
testcase_15 AC 124 ms
55,640 KB
testcase_16 AC 125 ms
55,636 KB
testcase_17 AC 124 ms
55,836 KB
testcase_18 AC 125 ms
55,840 KB
testcase_19 AC 124 ms
55,992 KB
testcase_20 AC 125 ms
55,920 KB
testcase_21 AC 124 ms
55,944 KB
testcase_22 AC 123 ms
55,784 KB
testcase_23 AC 125 ms
55,604 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.lang.System.*;
import java.util.Scanner;


public class file{
    public static void main (String[]args){
        Scanner sc = new Scanner(System.in);
        int a,b,c,d,e,r,sum,x;
        a = sc.nextInt();
        b = sc.nextInt();
        c = sc.nextInt();
        d = sc.nextInt();
        e = sc.nextInt();
        sum=d;
        r = d;
        x=d;
        if(b-c!=0){
            for(int i=2;i<=a*(b-c);i++){
                if(i%10!=0){
                    r= x;
                    sum+=r;
                    x=r;
                }else if(i%10==0&&e<=x){
                    r=x-e;
                    sum+=r;
                    x=r;
    
                }else if(i%10==0&&e>x){
                    r=x;
                    sum+=r;
                    x=r;
                }

        }
        } else {
            sum=0;
        }
        System.out.println(sum);

    }
}
0