Submission #217122

# Submission time Handle Problem Language Result Execution time Memory
217122 2020-03-29T05:34:28 Z juggernaut 코알라 (JOI13_koala) C++14
0 / 100
8 ms 640 KB
//Just try and the idea will come
#include<bits/stdc++.h>
#define fr first
#define sc second
using namespace std;
typedef long long int ll;
ll k,m,d,a,n,i,dp[1001],j;
pair<ll,ll>p[1001];
int main(){
    scanf("%lld%lld%lld%lld%lld",&k,&m,&d,&a,&n);
    for(i=2;i<n+2;i++)scanf("%lld%lld",&p[i].fr,&p[i].sc);
    p[1]={k,0};
    p[++n]={m,0};
    for(i=2;i<=n;i++){
        dp[i]=1e9;
        for(j=1;j<i;j++)dp[i]=min(dp[i],dp[j]+a*((p[i].fr-p[j].fr+d-1)/d)-p[i].sc);
    }
    printf("%lld",dp[n]);
}

Compilation message

koala.cpp: In function 'int main()':
koala.cpp:10:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%lld%lld%lld%lld%lld",&k,&m,&d,&a,&n);
     ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
koala.cpp:11:28: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     for(i=2;i<n+2;i++)scanf("%lld%lld",&p[i].fr,&p[i].sc);
                       ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 8 ms 512 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 5 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 5 ms 640 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -