Submission #1077115
Source Code Expand
#define _USE_MATH_DEFINES #include "bits/stdc++.h" using namespace std; #define int long long #define DBG 1 #define dump(o) if(DBG){cerr<<#o<<" "<<o<<endl;} #define dumpc(o) if(DBG){cerr<<#o; for(auto &e:(o))cerr<<" "<<e;cerr<<endl;} #define rep(i,a,b) for(int i=(a);i<(b);i++) #define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--) #define each(it,c) for(auto it=(c).begin();it!=(c).end();it++) #define all(c) c.begin(),c.end() const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f; const int MOD = (int)(1e9 + 7); signed main() { int n, a, b; cin >> n >> a >> b; vector<int>v(n); rep(i, 0, n)cin >> v[i]; int ans = 0; rep(i, 0, n-1) { ans += min((v[i + 1] - v[i])*a, b); } cout << ans << endl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | D - Walk and Teleport |
User | norma |
Language | C++14 (GCC 5.4.1) |
Score | 500 |
Code Size | 764 Byte |
Status | AC |
Exec Time | 44 ms |
Memory | 1024 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 500 / 500 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample_01.txt, sample_02.txt, sample_03.txt |
All | subtask_1_balancedmax_01.txt, subtask_1_balancedmax_02.txt, subtask_1_max_01.txt, subtask_1_max_02.txt, subtask_1_min_01.txt, subtask_1_onlya_01.txt, subtask_1_onlyamax_01.txt, subtask_1_onlyb_01.txt, subtask_1_onlybmax_01.txt, subtask_1_rand_01.txt, subtask_1_rand_02.txt, subtask_1_rand_03.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
sample_01.txt | AC | 3 ms | 256 KB |
sample_02.txt | AC | 3 ms | 256 KB |
sample_03.txt | AC | 3 ms | 256 KB |
subtask_1_balancedmax_01.txt | AC | 42 ms | 1024 KB |
subtask_1_balancedmax_02.txt | AC | 42 ms | 1024 KB |
subtask_1_max_01.txt | AC | 42 ms | 1024 KB |
subtask_1_max_02.txt | AC | 44 ms | 1024 KB |
subtask_1_min_01.txt | AC | 3 ms | 256 KB |
subtask_1_onlya_01.txt | AC | 23 ms | 640 KB |
subtask_1_onlyamax_01.txt | AC | 43 ms | 1024 KB |
subtask_1_onlyb_01.txt | AC | 12 ms | 384 KB |
subtask_1_onlybmax_01.txt | AC | 43 ms | 1024 KB |
subtask_1_rand_01.txt | AC | 28 ms | 768 KB |
subtask_1_rand_02.txt | AC | 36 ms | 896 KB |
subtask_1_rand_03.txt | AC | 17 ms | 512 KB |