Submission #1262749

#TimeUsernameProblemLanguageResultExecution timeMemory
1262749niepamietamhaslaBroken Device (JOI17_broken_device)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; void Anna(int n, ll x, int k, int* S){ 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(S[C] == 0 and S[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(S[C] == 0 and reszta == 1){ Set(C, 1); Set(N, 0); it += 2; x /= 3; } else if(S[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 <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; }

Compilation message (stderr)

# 1번째 컴파일 단계

Anna.cpp: In function 'void Anna(int, ll, int, int*)':
Anna.cpp:19:17: error: 'Set' was not declared in this scope
   19 |                 Set(C, 1);
      |                 ^~~
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, 0);
      |                 ^~~
Anna.cpp:36:13: error: 'Set' was not declared in this scope
   36 |             Set(C, 1);
      |             ^~~
Anna.cpp:42:13: error: 'Set' was not declared in this scope
   42 |             Set(C, 0);
      |             ^~~
Anna.cpp:48:13: error: 'Set' was not declared in this scope
   48 |             Set(C, 0);
      |             ^~~
Anna.cpp:55:9: error: 'Set' was not declared in this scope
   55 |         Set(C, 0);
      |         ^~~