subsequence.cpp:17:6: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
main()
^
subsequence.cpp: In function 'int main()':
subsequence.cpp:20:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d", &n);
~~~~~^~~~~~~~~~
subsequence.cpp:22:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d", &a[i]);
~~~~~^~~~~~~~~~~~~
subsequence.cpp:25:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d", &k[i]);
~~~~~^~~~~~~~~~~~~
subsequence.cpp:48:10: warning: iteration 100002 invokes undefined behavior [-Waggressive-loop-optimizations]
if(dp[i] > mx){
~~~~^
subsequence.cpp:47:19: note: within this loop
for(int i = 0; i < (1 << 20); i++){
~~^~~~~~~~~~~