結果
| 問題 | No.1453 手助け |
| コンテスト | |
| ユーザー |
jun612
|
| 提出日時 | 2021-04-01 15:21:48 |
| 言語 | Java (openjdk 23) |
| 結果 |
AC
|
| 実行時間 | 140 ms / 2,000 ms |
| コード長 | 896 bytes |
| 記録 | |
| コンパイル時間 | 3,490 ms |
| コンパイル使用メモリ | 74,892 KB |
| 実行使用メモリ | 54,360 KB |
| 最終ジャッジ日時 | 2024-12-17 19:11:06 |
| 合計ジャッジ時間 | 7,733 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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