結果
問題 | No.1453 手助け |
ユーザー |
![]() |
提出日時 | 2021-11-01 17:41:06 |
言語 | C++17(clang) (17.0.6 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 1,304 bytes |
コンパイル時間 | 2,474 ms |
コンパイル使用メモリ | 163,424 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-10 08:21:25 |
合計ジャッジ時間 | 3,057 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 21 |
ソースコード
#include "bits/stdc++.h"using namespace std;typedef string::const_iterator State;#define eps 1e-8L#define MAX_MOD 1000000007LL#define GYAKU 500000004LL#define MOD 998244353LL#define pb push_back#define mp make_pairtypedef long long ll;typedef long double ld;#define REP(a, b) for (long long(a) = 0; (a) < (b); ++(a))#define ALL(x) (x).begin(), (x).end()#define int long longvoid solve(){int a, b, c, d, e;cin >> a >> b >> c >> d >> e;b *= a;c *= a;int ans = 0;int back = 0;for (int i = 1; i <= b - c; i++){if(i == 1){ans += d;back = d;continue;}if(i % 10 != 0){ans += back;continue;}if(e <= back){ans += back - e;back = back - e;}else{ans += back;back = back;}}cout << ans << endl;}#undef int// generated by oj-template v4.7.2// (https://github.com/online-judge-tools/template-generator)int main(){// Fasterize input/output scriptios::sync_with_stdio(false);cin.tie(nullptr);cout << fixed << setprecision(100);// scanf/printf user should delete this fasterize input/output scriptint t = 1;// cin >> t; // comment out if solving multi testcasefor (int testCase = 1; testCase <= t; ++testCase){solve();}return 0;}