Submission #448297

# Submission time Handle Problem Language Result Execution time Memory
448297 2021-07-29T13:51:35 Z mosiashvililuka Bit Shift Registers (IOI21_registers) C++17
10 / 100
1 ms 292 KB
#include<bits/stdc++.h>
#include "registers.h"
using namespace std;
int a,b,c,d,e,i,j,ii,jj,zx,xc,k,n,B=2000,ANS;
vector <bool> v;
void construct_instructions(int Ss, int Nn, int Kk, int Qq) {
	ANS=3;b=B;
	n=Nn;a=n;v.resize(B);
	//0)r[1]=a r[2]=b
	append_move(1,0);
	append_right(2,0,2);//append_left(2,0,2);
	//1)r[ANS]=and(a,b)
	append_and(ANS,1,2);
	
	//1001
	
	//2)r[4]
	v[0]=1;v[1]=0;v[2]=0;v[3]=1;
	append_store(4,v);
	//3)r[5]=r[0] xor r[4]
	append_xor(5,0,4);
	//4)r[5]=not(r[5])
	append_not(5,5);
	//5)r[6]r[7]r[8]//r[9]
	append_left(6,5,1);//append_right(6,5,1);
	append_left(7,5,2);//append_right(7,5,2);
	append_left(8,5,3);//append_right(8,5,3);
	//6)r[5]=and
	append_and(5,5,6);
	append_and(5,5,7);
	append_and(5,5,8);
	//7)k=r[5][3]
	append_left(5,5,b-4);append_right(10,5,/*3*/b-1);//append_left(10,10,1);//append_left(10,5,3);append_right(10,10,1);
	//8)r[ANS][1]|=k
	append_or(ANS,ANS,10);
	
	//0110
	
	//2)r[4]
	v[0]=0;v[1]=1;v[2]=1;v[3]=0;
	append_store(4,v);
	//3)r[5]=r[0] xor r[4]
	append_xor(5,0,4);
	//4)r[5]=not(r[5])
	append_not(5,5);
	//5)r[6]r[7]r[8]//r[9]
	append_left(6,5,1);//append_right(6,5,1);
	append_left(7,5,2);//append_right(7,5,2);
	append_left(8,5,3);//append_right(8,5,3);
	//6)r[5]=and
	append_and(5,5,6);
	append_and(5,5,7);
	append_and(5,5,8);
	//7)k=r[5][3]
	append_left(5,5,b-4);append_right(10,5,/*3*/b-1);//append_left(10,10,1);//append_left(10,5,3);append_right(10,10,1);
	//8)r[ANS][1]|=k
	append_or(ANS,ANS,10);
	
	
	
	append_move(0,ANS);
	
	/*v[0]=0;v[1]=0;v[2]=0;v[3]=0;
	append_store(0,v);*/
}
/*int main(){
	cin>>a;
	cout<<a+4;
}*/
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 292 KB Wrong answer detected in grader
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Incorrect min value
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 292 KB Incorrect min value
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Incorrect sorting
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Incorrect sorting
2 Halted 0 ms 0 KB -