Submission #1029441

# Submission time Handle Problem Language Result Execution time Memory
1029441 2024-07-20T21:39:22 Z wood Bit Shift Registers (IOI21_registers) C++17
58 / 100
1 ms 600 KB
#include "registers.h"
#include <bits/stdc++.h>
using namespace std;

void construct_instructions(int s, int n, int k, int q) {
	vector<bool> nigga(2000);
	for(int i = n*k; i<2000; i++) nigga[i] = 1;
	append_store(97,nigga); append_or(0,97,0);
	int x = 1;
	while(x<n){
		int p = k*x;
		vector<bool> v(2000), v2(2000);
		for(int i = 0; i<2000; i++){
			v[i] = (i/p)%2;	
			v2[i] = !v[i]&&(i%p==0);
		}
		append_store(99,v);
		append_store(98,v2);

		//bitmasking
		append_move(1,0);
		append_and(1,99,1);
		append_right(1,1,p);
		append_not(99,99);
		append_and(0,99,0);

		append_print(0);
		append_print(1);

		//min finding
		append_add(2,2,98);
		append_not(2,1);
		//append_print(2);
		append_add(2,0,2);
		append_right(2,2,k);
		
		append_and(0,0,2);
		append_not(2,2);
		append_and(1,1,2);	
		append_or(0,0,1);
		append_print(0);


		x*=2;
	}
	return;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 1 ms 344 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 0 ms 344 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 600 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 436 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB Incorrect sorting
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB Incorrect sorting
2 Halted 0 ms 0 KB -