Submission #903489

#TimeUsernameProblemLanguageResultExecution timeMemory
903489abcvuitunggioBit Shift Registers (IOI21_registers)C++17
100 / 100
1 ms612 KiB
#include "registers.h" #include <bits/stdc++.h> using namespace std; const int b=2000; int k; void minimize(int d){ append_right(1,0,d); append_and(0,0,98); append_and(1,1,98); append_not(2,1); append_add(2,0,2); append_right(2,2,k); append_not(3,2); append_and(4,2,1); append_and(5,3,0); append_and(2,2,0); append_and(3,3,1); append_or(0,2,3); append_or(1,4,5); } void construct_instructions(int s, int n, int k, int q){ ::k=k; vector <bool> ve(b,0); for (int i=n*k;i<b;i++) ve[i]=1; append_store(99,ve); append_or(0,0,99); for (int i=0;i<b;i++) ve[i]=(i%(k*2)<k); append_store(98,ve); if (!s){ int d=k; while (n>1){ minimize(d); n=(n+1)/2; d*=2; } return; } for (int i=0;i<n;i++){ if (i&1){ append_left(6,0,b-k); append_right(6,6,b-k); append_right(0,0,k); append_or(0,0,99); } minimize(k); append_left(1,1,k); append_or(0,0,1); if (i&1){ append_left(0,0,k); append_or(0,0,6); } } }
#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...