//Challenge: Accepted
#include "registers.h"
#include <iostream>
#include <algorithm>
#include <vector>
#include <utility>
using namespace std;
void debug(){cout << endl;}
template<class T, class ... U> void debug(T a, U ... b){cout << a << " ", debug(b...);}
template<class T> void pary(T l, T r) {
while (l != r) cout << *l << " ", l++;
cout << endl;
}
#define ll long long
#define maxn 400005
#define pii pair<int, int>
#define ff first
#define ss second
#define io ios_base::sync_with_stdio(0);cin.tie(0);
const int m = 100;
const int b = 2000;
int n, k;
vector<bool> kb(b, 0);
void clean(int id) {
append_and(id, id, m - 2);
}
void push(int id) {
for (int i = 2;i < k*2;i *= 2) {
append_right(m - 1, id, i>>1);
append_or(id, id, m - 1);
}
}
void chmin(int ind) {
append_right(1, 0, ind*k);
append_xor(2, 0, 1);
clean(2);
push(2);
//append_print(2);
append_not(3, 2);
append_and(m - 3, 3, 0);
append_right(3, 3, 1);
append_and(4, 0, 2); append_and(5, 1, 2); //d, e
append_xor(4, 4, 2); append_xor(5, 5, 2);
append_and(6, 4, 3), append_and(7, 5, 3);
push(6), push(7);
//append_print(6), append_print(7);
append_and(6, 6, 0), append_and(7, 7, 1);
append_add(m - 3, 6, m - 3), append_add(0, m - 3, 7);
}
void construct_instructions(int s, int nn, int kk, int q) {
n = nn, k = kk;
for (int i = 0;i < k;i++) kb[i] = 1;
append_store(m - 2, kb);
for (int i = 1;i < n;i++) chmin(i);
}
/*
0 2 2 1000
0 1
1 0
*/
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
204 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
204 KB |
Wrong answer detected in grader |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
204 KB |
Output is correct |
2 |
Correct |
2 ms |
620 KB |
Output is correct |
3 |
Correct |
1 ms |
592 KB |
Output is correct |
4 |
Correct |
2 ms |
624 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
204 KB |
Wrong answer detected in grader |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
332 KB |
Incorrect sorting |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
332 KB |
Incorrect sorting |
2 |
Halted |
0 ms |
0 KB |
- |