結果

問題 No.1453 手助け
コンテスト
ユーザー suppy193
提出日時 2021-05-01 18:44:18
言語 C90
(gcc 15.2.0)
コンパイル:
gcc-15 -O2 -std=c90 -DONLINE_JUDGE -o a.out _filename_ -lm
実行:
./a.out
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 433 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 158 ms
コンパイル使用メモリ 39,216 KB
最終ジャッジ日時 2026-02-24 01:06:47
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <stdio.h>

int main(void) {

    int a, b, c, d, e;
	int x;
	int total = 0;
	int i;
    scanf("%d%d%d%d%d", &a, &b, &c, &d, &e);
	x = d;
	total = x;
	if(b == c){
		printf("0\n");
		return 0;
	}
	for(i = 2;i <= a * (b - c);i++){
		if(i % 10 != 0){
			total += x;
		}
		else {
			if(e <= x){
				x = x - e;
				if(x < 0)x = 0;
				total += x;
			}
			else {
				total += x;
			}
		}
	}
    printf("%d\n", total);

	return 0;
}
0