結果
| 問題 | 
                            No.1453 手助け
                             | 
                    
| コンテスト | |
| ユーザー | 
                             forest3
                         | 
                    
| 提出日時 | 2021-04-01 21:05:47 | 
| 言語 | C++14  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 3 ms / 2,000 ms | 
| コード長 | 390 bytes | 
| コンパイル時間 | 1,633 ms | 
| コンパイル使用メモリ | 166,156 KB | 
| 実行使用メモリ | 5,248 KB | 
| 最終ジャッジ日時 | 2024-12-21 05:02:36 | 
| 合計ジャッジ時間 | 2,565 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge5 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 21 | 
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main()
{
	int A, B, C, D, E;
	cin >> A >> B >> C >> D >> E;
	int a = A * (B  - C);
	int ans = 0;
	int X = 0;
	for( int i = 1; i <= a; i++ ) {
		if( i == 1 ) {
			X = D;
			ans = X;
		}
		else {
			if( i % 10 ) ans += X;
			else {
				if( X < E ) ans += X;
				else {
					X -= E;
					ans += X;
				}
			}
		}
	}
	cout << ans << endl;
}
            
            
            
        
            
forest3