結果
問題 | No.1453 手助け |
ユーザー |
![]() |
提出日時 | 2021-03-31 21:12:09 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 659 bytes |
コンパイル時間 | 2,030 ms |
コンパイル使用メモリ | 168,016 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-15 13:35:08 |
合計ジャッジ時間 | 2,955 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 21 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) using intt = int64_t; intt sum(const long &a, const long &b) { return (a + b) * (b - a + 1) / 2; } vector<char> alphabet={'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'}; int main() { cout << fixed << setprecision(10); int a,b,c,d,e; cin>>a>>b>>c>>d>>e; b-=c; int x=a*b; int p=0; int q=d; for(int i=1;i<=x;i++){ if(i%10!=0){ p+=q; } else if(e<=q){ q=max(0,q-e); p+=q; } else{ p+=q; } } cout<<p<<endl; }