結果
| 問題 | No.1453 手助け |
| コンテスト | |
| ユーザー |
jun612
|
| 提出日時 | 2021-04-01 15:21:48 |
| 言語 | Java (openjdk 25.0.2) |
| 結果 |
AC
|
| 実行時間 | 56 ms / 2,000 ms |
| コード長 | 896 bytes |
| 記録 | |
| コンパイル時間 | 3,511 ms |
| コンパイル使用メモリ | 85,940 KB |
| 実行使用メモリ | 43,212 KB |
| 最終ジャッジ日時 | 2026-05-26 22:35:12 |
| 合計ジャッジ時間 | 5,042 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 |
ソースコード
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);
}
}
jun612