Submission #483405

#TimeUsernameProblemLanguageResultExecution timeMemory
483405A_DCloud Computing (CEOI18_clo)C++14
0 / 100
14 ms35020 KiB
#include <bits/stdc++.h> #define int long long #define ii pair<int,int> #define F first #define S second using namespace std; const int N=2e3+100; int dp[N][N]; int c[N],f[N],v[N]; int C[N],F[N],V[N]; int n; int m; int bc(int i,int j) { if(i==n+1){ return 0; } if(j==m+1){ return 0; } int&ret=dp[i][j]; if(ret!=-1)return ret; ret=0; int u=V[j]-v[i]; if(f[i]<F[j])u=0; ret=max(ret,u+bc(i+1,j+1)); ret=max(ret,bc(i+1,j)); ret=max(ret,bc(i,j+1)); return ret; } void solve() { cin>>n; for(int i=1;i<=n;i++){ scanf("%lld",&c[i],&f[i],&v[i]); } cin>>m; for(int i=1;i<=n;i++){ scanf("%lld",&C[i],&F[i],&V[i]); } memset(dp,-1,sizeof(dp)); cout<<bc(1,1)<<endl; } main() { // freopen("face.in","r",stdin); // freopen("face.out","w",stdout); int t=1; // cin>>t; while(t--){ solve(); } }

Compilation message (stderr)

clo.cpp: In function 'void solve()':
clo.cpp:37:15: warning: too many arguments for format [-Wformat-extra-args]
   37 |         scanf("%lld",&c[i],&f[i],&v[i]);
      |               ^~~~~~
clo.cpp:41:15: warning: too many arguments for format [-Wformat-extra-args]
   41 |         scanf("%lld",&C[i],&F[i],&V[i]);
      |               ^~~~~~
clo.cpp: At global scope:
clo.cpp:46:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   46 | main()
      | ^~~~
clo.cpp: In function 'void solve()':
clo.cpp:37:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   37 |         scanf("%lld",&c[i],&f[i],&v[i]);
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
clo.cpp:41:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   41 |         scanf("%lld",&C[i],&F[i],&V[i]);
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...