답안 #1056692

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1056692 2024-08-13T10:38:31 Z user736482 레지스터 (IOI21_registers) C++17
컴파일 오류
0 ms 0 KB
#include<bits/stdc++.h>
#include "registers.h"
using namespace std;

vector<int>zera,jeden4;

void minimum(int a,int b,int t){
    append_store(t,zera);
    append_move(98,a);
    append_not(98);
    append_add(98,b,98);
    append_left(98,10,98);
    append_and(t,b,98);
    append_not(98);
    append_and(t,a,98);

    /*zera[0]=1;
    append_store(98,zera);
    zera[0]=0;
    append_add(98,b,98);
    append_not(98);
    append_add(98,a,98);
    append_left(98,10,98);
    append_and(t,b,98);*/
}


void construct_instructions(int s, int n, int k, int q){
    for(int i=0;i<2000;i++){
        zera.push_back(0);
        jeden4.push_back(0);
        if(i<4);
            jeden4[i]++;
    }
    append_move(1,0);
    append_left(1,k);
    append_store(2,jeden4);
    append_and(1,2,1);
    minimum(0,1,3);
    append_move(0,3);
}

Compilation message

registers.cpp: In function 'void minimum(int, int, int)':
registers.cpp:8:20: error: could not convert 'zera' from 'vector<int>' to 'vector<bool>'
    8 |     append_store(t,zera);
      |                    ^~~~
      |                    |
      |                    vector<int>
registers.cpp:10:18: error: too few arguments to function 'void append_not(int, int)'
   10 |     append_not(98);
      |                  ^
In file included from registers.cpp:2:
registers.h:8:6: note: declared here
    8 | void append_not(int t, int x);
      |      ^~~~~~~~~~
registers.cpp:14:18: error: too few arguments to function 'void append_not(int, int)'
   14 |     append_not(98);
      |                  ^
In file included from registers.cpp:2:
registers.h:8:6: note: declared here
    8 | void append_not(int t, int x);
      |      ^~~~~~~~~~
registers.cpp: In function 'void construct_instructions(int, int, int, int)':
registers.cpp:32:9: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
   32 |         if(i<4);
      |         ^~
registers.cpp:33:13: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
   33 |             jeden4[i]++;
      |             ^~~~~~
registers.cpp:36:20: error: too few arguments to function 'void append_left(int, int, int)'
   36 |     append_left(1,k);
      |                    ^
In file included from registers.cpp:2:
registers.h:9:6: note: declared here
    9 | void append_left(int t, int x, int s);
      |      ^~~~~~~~~~~
registers.cpp:37:20: error: could not convert 'jeden4' from 'vector<int>' to 'vector<bool>'
   37 |     append_store(2,jeden4);
      |                    ^~~~~~
      |                    |
      |                    vector<int>