Submission #609860

#TimeUsernameProblemLanguageResultExecution timeMemory
609860dualityBit Shift Registers (IOI21_registers)C++17
100 / 100
4 ms596 KiB
#define DEBUG 0 #include <bits/stdc++.h> using namespace std; #if DEBUG // basic debugging macros int __i__,__j__; #define printLine(l) for(__i__=0;__i__<l;__i__++){cout<<"-";}cout<<endl #define printLine2(l,c) for(__i__=0;__i__<l;__i__++){cout<<c;}cout<<endl #define printVar(n) cout<<#n<<": "<<n<<endl #define printArr(a,l) cout<<#a<<": ";for(__i__=0;__i__<l;__i__++){cout<<a[__i__]<<" ";}cout<<endl #define print2dArr(a,r,c) cout<<#a<<":\n";for(__i__=0;__i__<r;__i__++){for(__j__=0;__j__<c;__j__++){cout<<a[__i__][__j__]<<" ";}cout<<endl;} #define print2dArr2(a,r,c,l) cout<<#a<<":\n";for(__i__=0;__i__<r;__i__++){for(__j__=0;__j__<c;__j__++){cout<<setw(l)<<setfill(' ')<<a[__i__][__j__]<<" ";}cout<<endl;} // advanced debugging class // debug 1,2,'A',"test"; class _Debug { public: template<typename T> _Debug& operator,(T val) { cout << val << endl; return *this; } }; #define debug _Debug(), #else #define printLine(l) #define printLine2(l,c) #define printVar(n) #define printArr(a,l) #define print2dArr(a,r,c) #define print2dArr2(a,r,c,l) #define debug #endif // define #define MAX_VAL 999999999 #define MAX_VAL_2 999999999999999999LL #define EPS 1e-6 #define mp make_pair #define pb push_back // typedef typedef unsigned int UI; typedef long long int LLI; typedef unsigned long long int ULLI; typedef unsigned short int US; typedef pair<int,int> pii; typedef pair<LLI,LLI> plli; typedef vector<int> vi; typedef vector<LLI> vlli; typedef vector<pii> vpii; typedef vector<plli> vplli; // ---------- END OF TEMPLATE ---------- #include "registers.h" const int b = 2000; void construct_instructions(int s,int n,int k,int q) { int i,j; if (s == 0) { vector<bool> v(b); for (i = 0; i < b; i++) v[i] = (i >= n*k); append_store(1,v); append_or(0,0,1); for (i = 1; i < n; i *= 2) { append_right(1,0,k*i); append_not(2,0); for (j = 0; j < b; j++) v[j] = (((j/k) % (2*i)) == 0); append_store(3,v); append_and(2,2,3); append_and(1,1,3); append_add(2,1,2); append_right(2,2,k); append_add(2,2,3); append_and(2,2,3); append_xor(1,0,1); append_and(2,1,2); append_xor(0,0,2); } } else { vector<bool> v(b); for (i = 0; i < b; i++) v[i] = (i >= n*k); append_store(1,v); append_or(0,0,1); for (i = 0; i < n; i++) { append_right(1,0,k); append_not(2,0); for (j = 0; j < b; j++) v[j] = (((j/k) & 1) == (i & 1)); append_store(3,v); append_and(2,2,3); append_and(1,1,3); append_add(2,1,2); append_right(2,2,k); append_add(2,2,3); append_and(2,2,3); append_xor(1,0,1); append_and(1,1,3); append_and(2,1,2); append_left(1,2,k); append_or(2,1,2); append_xor(0,0,2); } for (i = 0; i < b; i++) v[i] = (i < n*k); append_store(1,v); append_and(0,0,1); } }
#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...