Submission #1143696

#TimeUsernameProblemLanguageResultExecution timeMemory
1143696dpsaveslivesQuestion (Grader is different from the original contest) (CEOI14_question_grader)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;

int encode(int n, int x, int y){
	static vector<int> dp(921);
	if(dp[0] == 0){
		int cnt = 0;
		for (int S = 1; S < (1 << 12) && cur <= 920; ++S)
			if (__builtin_popcount(S) == 6)
				dp[++cur] = S;
		dp[0] = -1;
	}
	int ans;
	for(int k = 0; k < 12; ++k)
		if((dp[x] & (1 << k)) && !(dp[y] & (1 << k)))
			ans = k;

	return ans + 1;
}
#include <bits/stdc++.h>
using namespace std; 
int decode(int N, int Q, int H){
  vector<int> dp(921); 
  if(dp[0] == 0){
    int cur = 0;
    for(int S = 1;S < (1<<12) && cur <= 920;++S){
        if(__builtin_popcount(S) == 6){
            dp[++cur] = S;
        }
    }
    dp[0] = -1;   
  }
  if(dp[Q]&(1<<(H-1))){
    return 1; 
  }
  return 0; 
}

Compilation message (stderr)

# 1번째 컴파일 단계

encoder.cpp: In function 'int encode(int, int, int)':
encoder.cpp:8:50: error: 'cur' was not declared in this scope
    8 |                 for (int S = 1; S < (1 << 12) && cur <= 920; ++S)
      |                                                  ^~~