Submission #1223889

#TimeUsernameProblemLanguageResultExecution timeMemory
1223889hengliaoBit Shift Registers (IOI21_registers)C++20
22 / 100
1 ms748 KiB
#include "registers.h" #include<bits/stdc++.h> using namespace std; #define F first #define S second #define pb push_back #define vll vector<ll> #define pll pair<ll, ll> typedef int ll; namespace{ const int LOG=4; const int diff=100; const ll B=2000; const ll m=100; } void construct_instructions(int s, int n, int k, int q) { vector<bool> v1(B), v2(B); for(ll i=0;i<k;i++){ v1[i]=1; } for(ll i=diff;i<diff+k;i++){ v2[i]=1; } append_store(m-2, v1); append_store(m-1, v2); auto find_small=[&](int a){ append_right(3, a, diff); append_and(4, a, 3); append_and(4, 4, m-2); append_left(5, 4, diff); append_or(4, 5, 4); append_xor(6, 4, a); append_print(6); append_not(7, 6); append_print(7); for(int i=0;i<LOG;i++){ append_right(8, 7, (1<<i)); append_and(7, 7, 8); } append_right(9, 7, diff); append_and(9, m-2, 9); append_and(7, 7, m-2); append_left(7, 7, diff); append_or(9, 7, 9); append_and(6, 6, 9); for(int i=0;i<LOG;i++){ append_right(8, 6, (1<<i)); append_or(6, 6, 8); } append_or(a, a, 6); append_right(3, a, diff); append_and(4, a, 3); append_and(4, 4, m-2); return 4; }; append_move(1, 0); append_and(1, 1, m-2); for(ll i=1;i<n;i++){ append_right(2, 0, i*k); append_print(2); append_left(2, 2, diff); append_and(2, 2, m-1); append_or(1, 1, 2); append_print(1); append_move(1, find_small(1)); } append_move(0, 1); return; }
#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...