Submission #1075633

#TimeUsernameProblemLanguageResultExecution timeMemory
1075633mickey080929Bit Shift Registers (IOI21_registers)C++17
46 / 100
3 ms860 KiB
#include "registers.h" #include <bits/stdc++.h> using namespace std; void append_move(int t, int y); void append_store(int t, vector<bool> b); void append_and(int t, int x, int y); void append_or(int t, int x, int y); void append_xor(int t, int x, int y); void append_not(int t, int x); void append_left(int t, int x, int p); void append_right(int t, int x, int p); void append_add(int t, int x, int y); void append_print(int t); static const int m = 100; static const int b = 2000; void cmp_and_swap(int u, int v, int k) { append_right(1, 0, k*u); append_right(2, 0, k*v); vector<bool> arr(b, 0); fill(arr.begin(), arr.begin()+k, 1); append_store(3, arr); append_and(1, 1, 3); append_and(2, 2, 3); append_not(3, 1); fill(arr.begin(), arr.end(), 0); arr[0] = 1; append_store(4, arr); append_add(4, 2, 4); append_add(4, 3, 4); append_right(4, 4, b-k); append_xor(5, 1, 2); append_and(5, 4, 5); append_left(6, 5, k*u); append_xor(0, 0, 6); append_left(6, 5, k*v); append_xor(0, 0, 6); } void construct_instructions(int s, int n, int k, int q) { if (s == 0) { for (int i=n-2; i>=0; i--) { cmp_and_swap(i, i+1, k); } } else { for (int i=0; i<=n-1; i++) { for (int j=n-2; j>=i; j--) { cmp_and_swap(j, j+1, k); } } } }
#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...