Submission #818745

# Submission time Handle Problem Language Result Execution time Memory
818745 2023-08-10T06:36:21 Z alvingogo Bit Shift Registers (IOI21_registers) C++17
22 / 100
1 ms 340 KB
#include "registers.h"
#include <bits/stdc++.h>
#define fs first
#define sc second
#define p_q priority_queue
using namespace std;

const int m=100,b=2000;
void construct_instructions(int s, int n, int k, int q) {
	if(s==0){
		vector<bool> le(b);
		for(;n<128;n++){
			for(int j=0;j<k;j++){
				le[n*k+j]=1;
			}
		}
		append_store(99,le);
		append_or(0,0,99);
		int w=2*k;
		for(int p=0;p<7;p++){
			vector<bool> v(b),zero(b),one(b);
			for(int j=0;j<n*k;j+=w){
				for(int i=0;i<k;i++){
					v[j+i]=1;
				}
				one[j]=1;
			}
			append_store(98,v);
			append_store(97,one);
			append_right(1,0,w/2);
			append_and(0,0,98);

			append_xor(2,0,1);
			int z=3,f=4;
			append_store(3,one);
			append_store(4,zero);
			int nw=5;
			for(int i=k-1;i>=0;i--){
				// z && (c>>i) && (a>>i) then 4 is true;
				int c=nw;
				append_right(nw,2,i);
				nw++;
				int d=nw;
				append_right(nw,0,i);
				nw++;
				append_and(d,d,c);
				append_and(d,d,z);
				append_and(d,d,97);
				append_or(f,f,d);
				// (c>>i) -> z = 0;
				append_xor(c,c,97);
				append_and(z,z,c);
			}
			append_and(f,f,97);
			append_add(f,f,98);
			append_xor(f,f,98);
			append_and(f,f,2);
			append_xor(0,0,f);
			w<<=1;
		}
	}
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Wrong answer detected in grader
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 1 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Wrong answer detected in grader
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Incorrect sorting
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Incorrect sorting
2 Halted 0 ms 0 KB -