제출 #1262752

#제출 시각아이디문제언어결과실행 시간메모리
1262752niepamietamhaslaBroken Device (JOI17_broken_device)C++20
컴파일 에러
0 ms0 KiB
#include "Brunolib.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; void Anna(int n, ll x, int k, int* S){ vector<int> czy(n, 0); for(int i = 0; i < k; ++i){ czy[S[i]] = 1; } vector<int> P; for(int i = 0; i < n; ++i){ P.push_back(i); } unsigned seed = 5; shuffle (P.begin(), P.end(), default_random_engine(seed)); int it = 0; while(x > 0){ int reszta = x % 3; ll C = P[it]; ll N = P[it+1]; if(czy[C] == 0 and czy[N] == 0){ if(reszta == 2){ Set(C, 1); Set(N, 1); it+=2; } else if(reszta == 1){ Set(C, 1); Set(N, 0); it+=2; } else{ Set(C, 0); Set(N, 1); it+=2; } x /= 3; } else if(czy[C] == 0 and reszta == 1){ Set(C, 1); Set(N, 0); it += 2; x /= 3; } else if(czy[N] == 0 and reszta == 0){ Set(C, 0); Set(N, 1); it += 2; x /= 3; } else{ Set(C, 0); Set(N, 0); it += 2; } } while(it < n) { ll C = P[it]; Set(C, 0); ++it; } return; }
#include "Brunolib.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; ll Bruno(int n, int* A){ vector<int> P; for(int i = 0; i < n; ++i){ P.push_back(i); } unsigned seed = 5; shuffle (P.begin(), P.end(), default_random_engine(seed)); ll pot = 1; ll S = 0; for(int i = 0; i < n; i += 2){ if(A[i] == 0 and A[i+1] == 0){ continue; } else if(A[i] == 1 and A[i+1] == 1){ S += 2 * pot; pot *= 3; } else if(A[i] == 1){ S += pot; pot *= 3; } else{ pot *= 3; } } return S; }

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

# 1번째 컴파일 단계

Anna.cpp: In function 'void Anna(int, ll, int, int*)':
Anna.cpp:24:17: error: 'Set' was not declared in this scope
   24 |                 Set(C, 1);
      |                 ^~~
Anna.cpp:29:17: error: 'Set' was not declared in this scope
   29 |                 Set(C, 1);
      |                 ^~~
Anna.cpp:34:17: error: 'Set' was not declared in this scope
   34 |                 Set(C, 0);
      |                 ^~~
Anna.cpp:41:13: error: 'Set' was not declared in this scope
   41 |             Set(C, 1);
      |             ^~~
Anna.cpp:47:13: error: 'Set' was not declared in this scope
   47 |             Set(C, 0);
      |             ^~~
Anna.cpp:53:13: error: 'Set' was not declared in this scope
   53 |             Set(C, 0);
      |             ^~~
Anna.cpp:60:9: error: 'Set' was not declared in this scope
   60 |         Set(C, 0);
      |         ^~~