Submission #330132
Source Code Expand
#include<bits/stdc++.h>
using namespace std;
int n,m,j,k,i,l;
int A[100000];
int B[100000];
int dp[150005];
int mx = -541;
void f(int x,int z,int q){
/* getchar();
cout << x << ' ' << z << ' ' << q << endl;
*/
if(x == n)
{
mx = max(q,mx);
return ;
}
if(z > m+k)
return ;
f(x,z+1,q);
if(z > m)
f(x+B[z-m],z+1,q+B[z-m]-1);
else
f(x+A[z],z+1,q+A[z]);
}
int main(){
scanf("%d %d %d",&n,&m,&k);
for(i=1 ; i<=m ; i++)
scanf("%d",&A[i]);
for(i=1 ; i<=k ; i++)
scanf("%d",&B[i]);
f(0,1,0);
printf("%d",mx);
return 0;
}
Submission Info
Submission Time
2015-02-02 17:00:50+0900
Task
14 - Farmer
User
Kerem
Language
C++ (G++ 4.6.4)
Score
0
Code Size
661 Byte
Status
WA
Exec Time
1034 ms
Memory
1064 KB
Compile Error
./Main.cpp: In function ‘int main()’:
./Main.cpp:37:30: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
./Main.cpp:40:24: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
./Main.cpp:43:24: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
Judge Result
Set Name
Set01
Set02
Set03
Set04
Set05
Set06
Set07
Set08
Set09
Set10
Set11
Set12
Set13
Set14
Set15
Set16
Set17
Set18
Set19
Set20
Score / Max Score
0 / 5
0 / 5
0 / 5
0 / 5
0 / 5
0 / 5
0 / 5
0 / 5
0 / 5
0 / 5
0 / 5
0 / 5
0 / 5
0 / 5
0 / 5
0 / 5
0 / 5
0 / 5
0 / 5
0 / 5
Status
Set Name
Test Cases
Set01
01
Set02
02
Set03
03
Set04
04
Set05
05
Set06
06
Set07
07
Set08
08
Set09
09
Set10
10
Set11
11
Set12
12
Set13
13
Set14
14
Set15
15
Set16
16
Set17
17
Set18
18
Set19
19
Set20
20
Case Name
Status
Exec Time
Memory
01
TLE
1032 ms
932 KB
02
TLE
1034 ms
924 KB
03
WA
24 ms
756 KB
04
WA
25 ms
804 KB
05
WA
23 ms
800 KB
06
TLE
1032 ms
800 KB
07
TLE
1032 ms
924 KB
08
TLE
1031 ms
928 KB
09
TLE
1034 ms
936 KB
10
TLE
1033 ms
932 KB
11
TLE
1032 ms
1008 KB
12
TLE
1032 ms
1004 KB
13
TLE
1033 ms
932 KB
14
TLE
1032 ms
1056 KB
15
TLE
1033 ms
936 KB
16
TLE
1033 ms
1048 KB
17
TLE
1032 ms
1064 KB
18
TLE
1033 ms
1056 KB
19
TLE
1033 ms
1064 KB
20
TLE
1033 ms
920 KB