답안 #992112

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
992112 2024-06-04T00:10:38 Z PedroBigMan Training (IOI07_training) C++14
컴파일 오류
0 ms 0 KB
 vector<ll> thisdp(1<<S,0);
        REP(i,0,P)
        {
            A = costs[i].ff.ff; B = costs[i].ff.ss; C = costs[i].ss; 
            ll valA = 0; if(A>=0) {valA=(1<<A);}
            ll valB = 0; if(B>=0) {valB=(1<<B);}
            ll rec = valA+valB;
            for(ll j = (1<<S) -1; j>=0; j--)
            {
                if(A>=0 && (j&valA)==0) {continue;}
                if(B>=0 && (j&valB)==0) {continue;}
                thisdp[j]=max(thisdp[j],thisdp[j-rec]+C);
            }
        }
        dp[s][S] = thisdp[(1<<S) -1];
        REP(i,0,S) {dp[s][i]=thisdp[(1<<S)-1-(1<<i)];}

Compilation message

training.cpp:1:2: error: 'vector' does not name a type
    1 |  vector<ll> thisdp(1<<S,0);
      |  ^~~~~~
training.cpp:2:12: error: expected constructor, destructor, or type conversion before '(' token
    2 |         REP(i,0,P)
      |            ^
training.cpp:15:9: error: 'dp' does not name a type
   15 |         dp[s][S] = thisdp[(1<<S) -1];
      |         ^~
training.cpp:16:12: error: expected constructor, destructor, or type conversion before '(' token
   16 |         REP(i,0,S) {dp[s][i]=thisdp[(1<<S)-1-(1<<i)];}
      |            ^