Submission #439632

# Submission time Handle Problem Language Result Execution time Memory
439632 2021-06-30T11:40:33 Z cheeheng Bit Shift Registers (IOI21_registers) C++17
10 / 100
1 ms 332 KB
#include "registers.h"
#include <bits/stdc++.h>
using namespace std;

void construct_instructions(int s, int n, int k, int q) {
    assert(s == 0 && n == 2);
    const int b = 2000;

	vector<bool> k1(b);
	for(int i = 0; i < k; i ++){
        k1[i] = 1;
	}
	vector<bool> one(b);
	one[0] = 1;
	append_store(2, k1);
	append_and(1, 0, 2);
	append_right(0, 0, k);

	append_move(12, 0);
	append_move(13, 1);

	append_not(12, 12);
	append_not(13, 13);

	append_not(3, 13);
	append_store(4, one);
    append_add(5, 3, 4);
    append_add(6, 12, 5);

    append_and(7, 6, 2); // 7 stores value of number
    append_right(6, 6, k); // 6 stores which is greater

    // 8 is all one or all 0 in the size of k
    append_move(8, 6);
    for(int i = 1; i < k; i ++){
        append_left(8, 8, 1);
        append_or(8, 8, 6);
    }

    append_move(9, 7);
    append_and(9, 8, 9);
    append_not(10, 9);
    append_add(11, 10, 4);
    append_add(12, 12, 11);

    append_not(12, 12);
    append_move(0, 12);

	return;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 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 Runtime error 1 ms 332 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 332 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 332 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 332 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -