Submission #440096

# Submission time Handle Problem Language Result Execution time Memory
440096 2021-07-01T15:10:33 Z algorithm16 Bit Shift Registers (IOI21_registers) C++17
21 / 100
1 ms 204 KB
#include "registers.h"
#include<iostream>
#include<algorithm>
using namespace std;
int ind=6,b=2000,r=2;
void flip(int x) {
	append_not(x,x);
	//append_left(x,x,b-1);
	//append_right(x,x,b-1);
}
void is0(int x,int y,int bit,int op) {
	//append_left(ind,x,b-1-bit);
	/*if(bit)*/ append_right(ind,x,bit);
	flip(ind);
	if(op) append_and(y,y,ind);
	else append_or(y,y,ind);
	ind+=1;
}
void not0(int x,int y,int bit,int op) {
	//append_left(ind,x,b-1-bit);
	if(bit) append_right(x,x,bit);
	if(op) append_and(y,y,x);
	else append_or(y,y,x);
	ind+=1;
}
void construct_instructions(int s,int n,int k,int q) {
	if(k==1) {
		append_move(1,0);
		append_right(1,1,1);
		append_and(0,0,1);
		return;
	}
	append_move(1,0);
	append_right(1,1,2);
	append_and(2,0,1);
	append_move(20,2);
	// 3 4 5
	not0(20,3,0,0);
	not0(20,3,1,0);
	flip(3);
	not0(0,4,0,0);
	not0(0,4,1,0);
	not0(1,5,0,0);
	not0(1,5,1,0);
	append_and(3,3,4);
	append_and(3,3,5);
	append_left(3,3,b-1);
	append_right(3,3,b-1);
	append_add(2,2,3);
	append_move(0,2);
	return;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
# 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 204 KB Incorrect min value
2 Halted 0 ms 0 KB -
# 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 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 -