제출 #1114196

#제출 시각아이디문제언어결과실행 시간메모리
1114196siewjh레지스터 (IOI21_registers)C++17
21 / 100
1 ms336 KiB
#include "registers.h" #include <bits/stdc++.h> using namespace std; const int b = 2000; void construct_instructions(int s, int n, int k, int q){ if (s == 0){ int rnds = log2(n), tlen = k * (1 << rnds); vector<bool> fl(b, 0), kgrp(b, 0); for (int i = n * k; i < tlen; i++) fl[i] = 1; append_store(10, fl); append_or(0, 0, 10); for (int i = 0; i < tlen; i += k) for (int j = 0; j < k; j++, i++) kgrp[i] = 1; append_store(11, kgrp); for (int i = 0, len = k; i < rnds; i++, len <<= 1){ append_right(1, 0, len); // 0 has odd pos, 1 has even pos append_and(0, 0, 11); append_not(2, 1); append_and(2, 2, 11); // 2 is negative 1, clean higher pos of 0 and 2 append_add(3, 0, 2); append_right(3, 3, k); append_and(3, 3, 11); // 0 if v0 < v1, 1 if v0 > v1 append_add(3, 3, 11); // 1...1 and 0...0 append_and(4, 0, 3); append_not(3, 3); append_and(5, 1, 3); append_or(0, 4, 5); // (v0 & v3) | (v1 & !v3) } } }
#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...