답안 #567912

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
567912 2022-05-24T10:45:52 Z mosiashvililuka 레지스터 (IOI21_registers) C++17
10 / 100
1 ms 212 KB
#include<bits/stdc++.h>
#include "registers.h"
using namespace std;
int a,b,c,d,e,i,j,ii,jj,zx,xc,K,M=100,B=2000;
vector <bool> vv;
void cle(vector <bool> &q){
	for(int h=0; h<q.size(); h++){
		q[h]=0;
	}
}
void miwuwyne(int q, int w){
	append_left(q,q,B-w);
	append_right(q,q,B-w);
}
void construct_instructions(int Ss, int Nn, int Kk, int Qq) {
	a=Nn;K=Kk;vv.resize(B);
	if(K==1){
		append_right(1,0,1);
		cle(vv);vv[0]=1;
		append_store(2,vv);
		append_and(0,2,0);
		append_and(0,0,1);
		return;
	}
	cle(vv);vv[0]=1;vv[1]=0;
	append_store(18,vv);//01 10 istvis pasuxi 01
	
	//
	
	append_right(1,0,2);
	cle(vv);vv[0]=1;vv[1]=1;
	append_store(2,vv);//R[2]=11
	append_and(0,2,0);
	//awi 0ze da 1ze weria is ori ricxvi
	append_and(17,0,1);//bituri da im ori ricxvis
	//axla 01 10 gamovcxrilot
	append_or(3,0,1);//bituri an im ori ricxvis
	append_right(4,3,1);//a2
	cle(vv);vv[0]=1;
	append_store(5,vv);//R[5]=10
	append_and(6,3,5);//a1
	append_and(7,4,6);//a1&a2
	append_move(8,0);
	append_right(8,8,1);//meore biti pirveli ricxvis
	append_and(9,0,8);//tu pirveli ricxvi 11ia mashin esec 1ia
	append_move(10,1);
	append_right(10,10,1);//
	append_and(11,1,10);//
	append_or(12,9,11);//tu romelime 11ia mashin 1ia esec
	append_not(13,12);//12is noti
	miwuwyne(13,1);
	//
	append_and(13,13,7);//a1&a2=1 unda iyos da arcertgan 11
	append_left(14,13,1);
	//
	append_or(15,13,14);//tu 01 10 aris mashin iqneba 11 tu arada 00 (anu 18-s koeficienti unda iyos 15)
	append_not(16,15);//17-is koeficietia 16
	
	append_and(20,17,16);append_and(21,18,15);
	append_add(0,20,21);//saboloo jami
}

Compilation message

registers.cpp: In function 'void cle(std::vector<bool>&)':
registers.cpp:7:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<bool>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    7 |  for(int h=0; h<q.size(); h++){
      |               ~^~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 212 KB Wrong answer detected in grader
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 212 KB Incorrect min value
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 212 KB Incorrect min value
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 212 KB Incorrect sorting
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 212 KB Incorrect sorting
2 Halted 0 ms 0 KB -