Submission #816430

#TimeUsernameProblemLanguageResultExecution timeMemory
816430blackyukiBit Shift Registers (IOI21_registers)C++17
75 / 100
2 ms628 KiB
#include "registers.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll,ll> P; typedef tuple<ll,ll,ll> PP; typedef vector<ll> vi; typedef vector<vi> vvi; typedef vector<P> vp; typedef vector<vp> vvp; typedef vector<bool> vb; #define rep(i,n) for(ll i=0;i<(ll)(n);i++) #define REP(i,k,n) for(ll i=(ll)(k);i<(ll)(n);i++) #define all(a) a.begin(),a.end() #define fi first #define se second #define pb emplace_back #define lb(v,k) (lower_bound(all(v),k)-v.begin()) template<class T> bool chmin(T&a,T b){if(a>b){a=b;return true;}return false;} template<class T> bool chmax(T&a,T b){if(a<b){a=b;return true;}return false;} template<class T> void out(T a){cout<<a<<'\n';} template<class T> void outv(T v){rep(i,v.size()){if(i)cout<<' ';cout<<v[i];}cout<<'\n';} const ll inf=1001001001001001001; void construct_instructions(int s, int n, int k, int q) { if(s==0&&n==2&&k<=2){ append_right(1,0,k); if(k==1){ append_and(0,0,1); } else{ append_and(2,0,1); append_right(3,0,1); append_right(4,1,1); append_not(5,3); append_and(5,0,5); append_and(5,4,5); append_not(6,4); append_and(6,1,6); append_and(6,3,6); append_or(3,5,6); vector<bool> v(2000);v[0]=1; append_store(4,v); append_and(3,3,4); append_or(0,2,3); } return; } rep(j,2){ vector<bool> v; rep(i,2000){ if(i/k%2==j)v.pb(1); else v.pb(0); } append_store(99-j,v); } rep(j,4){ vector<bool> v; rep(i,2000){ if(k-i%k-1>=(1<<j))v.pb(1); else v.pb(0); } append_store(97-j,v); } { vector<bool> v; rep(i,2000){ if(i%k==0)v.pb(1); else v.pb(0); } append_store(93,v); } append_left(0,0,k); { vector<bool> v; rep(i,2000){ if(i>=(n+1)*k)v.pb(1); else v.pb(0); } append_store(92,v); } append_or(0,0,92); // return; rep(c,n){ if(c==50)append_or(0,0,92); append_left(1,0,k); append_and(1,1,99-c%2); append_right(2,0,k); append_and(2,2,98+c%2); append_or(1,1,2); append_xor(2,0,1); { append_right(3,2,1); append_and(3,3,97); } rep(i,4){ append_right(4,3,1<<i); append_and(4,4,97-i); append_or(3,3,4); } append_add(3,3,93); append_and(3,0,3); rep(i,4){ append_right(4,3,1<<i); append_and(4,4,97-i); append_or(3,3,4); } append_and(2,2,3); append_and(3,0,98+c%2); append_and(4,1,99-c%2); append_or(3,3,4); append_xor(0,2,3); } append_right(0,0,k); }
#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...