Submission #770410

# Submission time Handle Problem Language Result Execution time Memory
770410 2023-07-01T07:31:23 Z PoonYaPat Copy and Paste 3 (JOI22_copypaste3) C++14
0 / 100
0 ms 212 KB
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int n;
string s;
ll dp[2505],a,b,c;

int main() {
    ios_base::sync_with_stdio(0); cin.tie(0);
    cin>>n>>s>>a>>b>>c;
    dp[1]=a;
    for (ll i=2; i<n; ++i) {
        dp[i]=i*a;
        for (ll j=1; j<i; ++j) dp[i]=min(dp[i],dp[j]+b+c*(i/j)+a*(i%j));
    }
    cout<<dp[n];
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -