# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
536894 | Hydroxic_Acid | Speedrun (RMI21_speedrun) | C++17 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "speedrun.h"
void assignHints(int subtask, int N, int A[], int B[]) {
setHintLen(20);
intcen = 0;
if(A[0] == A[1] || A[0] == B[1]) cen = A[0];
else cen = B[0];
for(int i = 0; i < N; i++){
int j = 1;
int temp = cen;
while(temp){
if(temp&-temp == 1){
setHint(i, j, true);
temp--;
}
temp >> 1; j++;
}
}
}
void speedrun(int subtask, int N, int start) {
int cen = 0;
for(int i = 1; i <= 10; i++){
if(getHint(i)) cen++;
cen << 1;
}
int left = N - 1;
while(left > 0){
if(start == cen){
while(!goTo(N))N--;
N--;
}
else{
left--;
goTo(cen);
}
}
}