제출 #1216264

#제출 시각아이디문제언어결과실행 시간메모리
1216264thelegendary08레지스터 (IOI21_registers)C++17
10 / 100
0 ms744 KiB
#include "registers.h"
#include<bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define vi vector<int>
#define f0r(i,n) for(int i = 0; i<n; i++)
#define FOR(i, k, n) for(int i = k; i<n; i++)
#define pii pair<int,int>
#define vvi vector<vector<int>>
#define vb vector<bool>
#define vpii vector<pair<int,int>>
#define vout(v) for(auto u : v)cout<<u<<' '; cout<<endl;
#define dout(x) cout<<x<<' '<<#x<<endl;
#define dout2(x,y) cout<<x<<' '<<#x<<' '<<y<<' '<<#y<<endl;
using namespace std;
const int m = 100;
const int b = 2000;
const int ONE = m-1; 
const int MINUSONE = m-2;
const int IIOO = m-3; 
const int OOII = m-4;
int cur = 1;
int identity(int x){
	append_add(cur, MINUSONE, x);
	cur++;
	append_not(cur, cur-1);
	cur++;
	return cur - 2;
}
int extract(int t, int k){
	append_right(cur, t, k); 
	append_and(cur, cur, ONE);
	cur++;
	return cur - 1;
}
void construct_instructions(int s, int n, int k, int q) {
	if(k != 1){
		/*
		cur = 1;
		vb one;
		one.pb(1);
		f0r(i, b-1)one.pb(0);
		append_store(m-1, one);
		*/
		vb minusone;
		f0r(i, b)minusone.pb(1);
		append_store(m-2, minusone);
		append_move(1, 0);
		f0r(i, n-1){
			append_right(1, 1, k);
			append_xor(2, 0, 1);
			append_not(3, 2);
			append_or(4, 0, 3);
			append_and(5, 2, 0);
			f0r(j, k){
				append_and(6,6,4);
				append_or(6,6,5);
				append_right(4,4,1);
				append_right(5,5,1);
				// append_print(6);
			}
			append_left(6,6,b-1);
			append_right(6,6,b-1);
			append_add(6, 6, MINUSONE); //is 0?
			// append_print(7); append_print(8);
			append_and(10,0,6);
			// append_print(10);
			append_not(6,6);
			append_and(9,1,6);
			append_or(0,10,9);
		}
	}
	else{
		append_move(1,0);
		append_right(1, 1, 1);
		append_and(0, 0, 1);
	}
	
	

}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...