제출 #53816

#제출 시각아이디문제언어결과실행 시간메모리
53816grumpy_gordonCity (JOI17_city)C++17
컴파일 에러
0 ms0 KiB
const int maxn = 2e5 + 10; const double w = 1.05; vector<int> e[maxn]; const double w = 1.05; int t; void dfs(int v, int par){ int tin = t++; for (int i : e[v]) if (i != par) dfs(i, v); int val = 0; double kek = 1; while ((int)pow(w, val) < t - tin) val++; t = tin + (int)pow(w, val); Code(v, val * (ll)maxn + tin); } void Encode(int N, int A[], int B[]) { int n = N; for (int i = 0; i < n - 1; i++){ int v = A[i], u = B[i]; e[v].push_back(u); e[u].push_back(v); } dfs(0, -1); }
const int maxn = 2e5 + 10; const double w = 1.05; void InitDevice(){ } int Answer(long long S, long long T) { int a = S / maxn, b = S % maxn, c = T / maxn, d = T % maxn; a = b + (int)pow(w, a) - 1; c = d + (int)pow(w, c) - 1; if (a >= c && b <= d) return 1; if (a <= c && b >= d) return 0; return 2; }

컴파일 시 표준 에러 (stderr) 메시지

Encoder.cpp:4:1: error: 'vector' does not name a type
 vector<int> e[maxn];
 ^~~~~~
Encoder.cpp:6:14: error: redefinition of 'const double w'
 const double w = 1.05;
              ^
Encoder.cpp:2:14: note: 'const double w' previously defined here
 const double w = 1.05;
              ^
Encoder.cpp: In function 'void dfs(int, int)':
Encoder.cpp:12:18: error: 'e' was not declared in this scope
     for (int i : e[v])
                  ^
Encoder.cpp:17:17: error: 'pow' was not declared in this scope
     while ((int)pow(w, val) < t - tin)
                 ^~~
Encoder.cpp:19:20: error: 'pow' was not declared in this scope
     t = tin + (int)pow(w, val);
                    ^~~
Encoder.cpp:20:20: error: 'll' was not declared in this scope
     Code(v, val * (ll)maxn + tin);
                    ^~
Encoder.cpp:20:5: error: 'Code' was not declared in this scope
     Code(v, val * (ll)maxn + tin);
     ^~~~
Encoder.cpp:16:12: warning: unused variable 'kek' [-Wunused-variable]
     double kek = 1;
            ^~~
Encoder.cpp: In function 'void Encode(int, int*, int*)':
Encoder.cpp:28:9: error: 'e' was not declared in this scope
         e[v].push_back(u);
         ^

Device.cpp: In function 'int Answer(long long int, long long int)':
Device.cpp:10:18: error: 'pow' was not declared in this scope
     a = b + (int)pow(w, a) - 1;
                  ^~~