結果

問題 No.1453 手助け
ユーザー soragsorag
提出日時 2022-08-03 15:50:33
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 619 bytes
コンパイル時間 576 ms
コンパイル使用メモリ 72,328 KB
実行使用メモリ 4,484 KB
最終ジャッジ日時 2023-10-11 10:02:01
合計ジャッジ時間 1,561 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 ms
4,476 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 1 ms
4,348 KB
testcase_06 WA -
testcase_07 AC 1 ms
4,352 KB
testcase_08 AC 2 ms
4,348 KB
testcase_09 AC 2 ms
4,348 KB
testcase_10 AC 1 ms
4,348 KB
testcase_11 AC 1 ms
4,348 KB
testcase_12 AC 2 ms
4,348 KB
testcase_13 AC 2 ms
4,352 KB
testcase_14 WA -
testcase_15 AC 2 ms
4,352 KB
testcase_16 AC 2 ms
4,348 KB
testcase_17 AC 2 ms
4,348 KB
testcase_18 AC 2 ms
4,352 KB
testcase_19 AC 1 ms
4,348 KB
testcase_20 AC 1 ms
4,348 KB
testcase_21 AC 2 ms
4,348 KB
testcase_22 AC 2 ms
4,352 KB
testcase_23 AC 1 ms
4,352 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <map>
#include<string>
#define ll long long
using namespace std;
int main() {
    int a,b,c,d,e,cnt;
    int ans=0;
    cin>>a>>b>>c>>d>>e;
    int cost=d;
    cnt=(b-c)*a;
    if(cnt==1 or cnt==0) ans=cnt*d;
    else {
        ans+=d;
        for (int i=2;i<=cnt;i++){
            if(i%10!=0) {
                 ans+=cost;
            }
            else if(i%10==0 and e<=d) {
                cost=(d-e); ans+=cost;
            }
            else if(i%10==0 and e>d){
              ans+=cost;
            }
        }
    }
    cout<<ans<<endl;
   
        return 0;
}


0