Submission #488170

# Submission time Handle Problem Language Result Execution time Memory
488170 2021-11-18T05:04:34 Z yungyao Bit Shift Registers (IOI21_registers) C++17
10 / 100
0 ms 332 KB
using namespace std;
#include "registers.h"
#pragma GCC optimize("Ofast")
#include <iostream>
#include <algorithm>
#include <vector>
#include <utility>
#include <stack>
#include <queue>
#include <set>
#include <map>

typedef long long LL;
typedef pair<int,int> pii;
#define F first
#define S second
#define pb push_back
#define mkp make_pair
#define iter(x) x.begin() x.end()
#define REP(n) for (int __=n;__--;)
#define REP0(i,n) for (int i=0;i<n;++i)
#define REP1(i,n) for (int i=1;i<=n;++i)

const int maxn = 0,mod = 0;
const LL inf = 0;

void solve2(int n,int k,int q){}

vector <bool> tran(int x){
    vector <bool> ret(2000,false);
    REP0(i,4) if ((x >> i) & 1) ret[i] = true;
    return ret;
}

void jizz(int x){
    REP1(i,3){
        append_left(99,x,i);
        append_or(x,x,99);
    }
    REP1(i,3){
        append_right(99,x,i);
        append_or(x,x,99);
    }
    append_not(x,x);
}

void construct_instructions(int s, int n, int k, int q){
    if (s == 1){
        solve2(n,k,q);
        return;
    }
    if (k == 1){
        append_right(1,0,1);
        append_print(0);
        append_print(1);
        append_not(0,0);
        append_not(1,1);
        append_or(0,0,1);
        append_not(0,0);
        append_print(0);
    }
    else if (k == 2){
        append_move(1,0);
        append_store(0,tran(0));
        append_print(1);

        append_store(49,tran(5));
        append_xor(69,1,49);
        jizz(69);
        append_store(70,tran(1));
        append_and(7,70,69);
        append_or(0,0,7);
        append_print(0);

        append_store(49,tran(6));
        append_xor(69,1,49);
        jizz(69);
        append_store(70,tran(1));
        append_and(7,70,69);
        append_or(0,0,7);
        append_print(0);

        append_store(49,tran(7));
        append_xor(69,1,49);
        jizz(69);
        append_store(70,tran(1));
        append_and(7,70,69);
        append_or(0,0,7);
        append_print(0);

        append_store(49,tran(9));
        append_xor(69,1,49);
        jizz(69);
        append_store(70,tran(1));
        append_and(7,70,69);
        append_or(0,0,7);
        append_print(0);

        append_store(49,tran(10));
        append_xor(69,1,49);
        jizz(69);
        append_store(70,tran(2));
        append_and(7,70,69);
        append_or(0,0,7);
        append_print(0);

        append_store(49,tran(11));
        append_xor(69,1,49);
        jizz(69);
        append_store(70,tran(2));
        append_and(7,70,69);
        append_or(0,0,7);
        append_print(0);

        append_store(49,tran(13));
        append_xor(69,1,49);
        jizz(69);
        append_store(70,tran(1));
        append_and(7,70,69);
        append_or(0,0,7);
        append_print(0);

        append_store(49,tran(14));
        append_xor(69,1,49);
        jizz(69);
        append_store(70,tran(2));
        append_and(7,70,69);
        append_or(0,0,7);
        append_print(0);

        append_store(49,tran(15));
        append_xor(69,1,49);
        jizz(69);
        append_store(70,tran(3));
        append_and(7,70,69);
        append_or(0,0,7);
        append_print(0);

    }
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 332 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB Wrong answer detected in grader
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB Incorrect min value
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB Incorrect min value
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB Incorrect sorting
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB Incorrect sorting
2 Halted 0 ms 0 KB -