Submission #69254

#TimeUsernameProblemLanguageResultExecution timeMemory
69254SmsSAliens (IOI16_aliens)C++14
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> using namespace std; #define ll long long #define for2(a,b,c) for(int a=b;a < c; a++) #include "aliens.h" int dp[510][1010]; int tmp[i510][1010]; int R[1010]; int C[1010]; long long take_photos(int n, int m, int k, std::vector<int> r, std::vector<int> c) { if (n > 500) return -1; fill(R,R+m+2,(1e9)); fill(C,C+m+2,(1e9)); for2(i,0,n){ R[r[i]]= min(R[r[i]],c[i]); C[c[i]]= min(C[c[i]],r[i]); } for2(i,0,510) for2(j,0,1010){ if(i <= k) dp[i][j] = 0; else dp[i][j] = 1e9; } for2(i,1,m+1){ for2(i,0,510) for2(j,0,1010){ tmp[i][j] = dp[i][j]; dp[i][j] = (1e9); } for2(j,0,k+1) for2(t,0,i+1){ int nt = t; nt = min(nt,C[i-1]); nt = min(nt,R[i-1]); if(j) dp[j][t] = min((ll)dp[j][t],tmp[j-1][nt] + (i-nt)*1ll*(i-nt) - (i-t)*1ll*(i-t) ); if(nt == t) dp[j][t] = min(dp[j][t],tmp[j][t]); if(nt == t && nt == i){ dp[j][t] = min(dp[j][t],tmp[j][t-1]); } } } return dp[k][m]; }

Compilation message (stderr)

aliens.cpp:8:9: error: 'i510' was not declared in this scope
 int tmp[i510][1010];
         ^~~~
aliens.cpp: In function 'long long int take_photos(int, int, int, std::vector<int>, std::vector<int>)':
aliens.cpp:26:4: error: 'tmp' was not declared in this scope
    tmp[i][j] = dp[i][j];
    ^~~
aliens.cpp:26:4: note: suggested alternative: 'tm'
    tmp[i][j] = dp[i][j];
    ^~~
    tm
aliens.cpp:33:38: error: 'tmp' was not declared in this scope
    if(j) dp[j][t] = min((ll)dp[j][t],tmp[j-1][nt] + (i-nt)*1ll*(i-nt) - (i-t)*1ll*(i-t) );
                                      ^~~
aliens.cpp:33:38: note: suggested alternative: 'tm'
    if(j) dp[j][t] = min((ll)dp[j][t],tmp[j-1][nt] + (i-nt)*1ll*(i-nt) - (i-t)*1ll*(i-t) );
                                      ^~~
                                      tm
aliens.cpp:34:40: error: 'tmp' was not declared in this scope
    if(nt == t) dp[j][t] = min(dp[j][t],tmp[j][t]);
                                        ^~~
aliens.cpp:34:40: note: suggested alternative: 'tm'
    if(nt == t) dp[j][t] = min(dp[j][t],tmp[j][t]);
                                        ^~~
                                        tm
aliens.cpp:36:29: error: 'tmp' was not declared in this scope
     dp[j][t] = min(dp[j][t],tmp[j][t-1]);
                             ^~~
aliens.cpp:36:29: note: suggested alternative: 'tm'
     dp[j][t] = min(dp[j][t],tmp[j][t-1]);
                             ^~~
                             tm