Submission #1005221

#TimeUsernameProblemLanguageResultExecution timeMemory
1005221vjudge1Bit Shift Registers (IOI21_registers)C++17
21 / 100
1 ms596 KiB
#include <bits/stdc++.h> #include "registers.h" #define all(x) (x).begin(),(x).end() using namespace std; using ll = long long; using ld = long double; //#define int ll #define sz(x) ((int)(x).size()) using pii = pair<int,int>; using tii = tuple<int,int,int>; const int BSIZE = 2000; namespace Utils { vector<bool> tobits(int x) { vector<bool> val; if(x == 0) { val.emplace_back(0); return val; } while(x > 0) { val.emplace_back(x & 1); x >>= 1; } return val; } vector<bool> multiply(vector<bool> v, int times) { vector<bool> R; while(times) { if(times & 1) copy(all(v), back_inserter(R)); times >>= 1; auto X = v; copy(all(X), back_inserter(v)); } return R; } vector<bool> concat(vector<bool> a, vector<bool> b) { copy(all(b), back_inserter(a)); return a; } vector<bool> ceil(vector<bool> a) { a.resize(BSIZE, 0); return a; } } using namespace Utils; #warning LEFT INSEAMNA CA SE MISCA i --> i - p (adica la stanga) namespace PulaMea { void amove(int t, int y) { append_move(t, y); } void astore(int t, vector<bool> a) { append_store(t, a); } void aand(int t, int x, int y) { append_and(t, x, y); } void aor(int t, int x, int y) { append_or(t, x, y); } void axor(int t, int x, int y) { append_xor(t, x, y); } void anot(int t, int x) { append_not(t, x); } void aright(int t, int x, int y) { append_left(t, x, y); } void aleft(int t, int x, int y) { append_right(t, x, y); } void asum(int t, int x, int y) { append_add(t, x, y); } void print(int t) { append_print(t); } } using namespace PulaMea; #define plus ashgafshasiuhqeuiasf const int simple = 99; const int plus = 98; void construct_instructions(int s, int n, int k, int q) { // doar S2 acum int even = 1, weirdeven = 5, odd = 2, thirdparty = 3, aux = 4; astore(simple, ceil(multiply(concat(multiply(tobits(1), k), multiply(tobits(0), k)), (BSIZE / (2 * k))))); astore(plus, ceil(multiply(concat(multiply(tobits(1), k + 1), multiply(tobits(0), k - 1)), (BSIZE / (2 * k))))); aand(even, 0, simple); //print(0); aleft(odd, 0, k); //aand(odd, odd, simple); // nenecesar //print(odd); anot(weirdeven, even); aand(weirdeven, weirdeven, plus); //print(weirdeven); //print(odd); asum(thirdparty, odd, weirdeven); aand(thirdparty, thirdparty, plus); //print(thirdparty); aleft(thirdparty, thirdparty, k); for(int i = 1; i < k; i *= 2) { aright(aux, thirdparty, i); aor(thirdparty, aux, thirdparty); } aand(aux, thirdparty, odd); anot(thirdparty, thirdparty); aand(thirdparty, thirdparty, even); asum(0, thirdparty, aux); //append_print(0); return; } /** Istenem! Nu poate fi real. -- Surse verificate */

Compilation message (stderr)

registers.cpp:47:2: warning: #warning LEFT INSEAMNA CA SE MISCA i --> i - p (adica la stanga) [-Wcpp]
   47 | #warning LEFT INSEAMNA CA SE MISCA i --> i - p (adica la stanga)
      |  ^~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...