Submission #619309

# Submission time Handle Problem Language Result Execution time Memory
619309 2022-08-02T11:04:27 Z KLPP Bit Shift Registers (IOI21_registers) C++17
22 / 100
1 ms 340 KB
#include "registers.h"
#include<bits/stdc++.h>

using namespace std;
typedef long long int lld;
#define rep(i,a,b) for(int i=a;i<b;i++)
#define trav(a,v) for(auto a:v)
vector<bool> b;
void construct_instructions(int s, int n, int k, int q) {
	b.resize(2000);
	rep(i,1,k+1){
		rep(j,0,2000)b[j]=false;
		for(int j=i-1;j<2000;j+=k){
			b[j]=true;
		}
		append_store(i,b);
	}
	rep(j,0,2000)b[j]=true;
	append_store(k+1,b);
	rep(j,0,2000)b[j]=false;
	rep(i,0,n)b[k-1+i*k]=true;
	append_store(k+2,b);
	//append_print(k+2);
	for(int i=k;i>0;i--){
		append_and(k+3,k+2,0);
		append_xor(k+3,i,k+3);
		append_and(k+3,k+3,k+2);
		append_move(k+4,k+3);
		//append_print(k+3);
		append_add(k+3,k+1,k+3);
		append_right(k+3,k+3,1999);
		append_add(k+3,k+3,k+1);
		append_not(k+3,k+3);
		append_or(k+4,k+3,k+4);
		append_and(k+4,k+2,k+4);
		//append_print(k+4);
		append_move(k+2,k+4);
		if(i>1)append_right(k+2,k+2,1);
	}
	//append_print(k+2);
	rep(i,0,k){
		append_and(k+5+i,k+2,0);
		append_print(k+5+i);
		append_add(k+5+i,k+1,k+5+i);
		append_right(k+5+i,k+5+i,1999);
		append_left(k+5+i,k+5+i,i);
		append_left(k+2,k+2,1);
	}
	append_or(0,0,k+1);
	rep(i,0,k){
		append_xor(0,0,k+5+i);
	}
	//append_print(0);
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 260 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 300 KB Wrong answer detected in grader
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 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 300 KB Wrong answer detected in grader
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 332 KB Incorrect sorting
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 332 KB Incorrect sorting
2 Halted 0 ms 0 KB -