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 "Joi.h"
typedef long long ll;
// X = message, T = subtask
//At place i, write 0
void Joi(int N, int M, int A[], int B[], long long X, int T) {
bool on[60];
for(int i = 0; i<60; i++){
if((X&(1LL<<i))!=0){
on[i] = true;
}
else{
on[i] = false;
}
}
for(int i = 0; i < N; i++){
MessageBoard(i, (on[i%60]?1:0));
}
}
#include "Ioi.h"
typedef long long ll;
//P = initial attraction, V = value there, T = sub
long long Ioi(int N, int M, int A[], int B[], int P, int V, int T) {
int know[60];
for(int i = 0; i<60; i++){
know[i] = -1;
}
know[P%60] = V;
int numKnow = 1;
int cur = P;
while(numKnow<60 && cur>0){
int there = Move(cur-1);
cur--;
know[cur%60] = there;
numKnow++;
}
while(numKnow<60){
int there = Move(cur+1);
cur++;
if(know[cur%60]==-1){
know[cur%60] = there;
numKnow++;
}
}
ll ret = 0LL;
for(int i = 0; i<60; i++){
ret += know[i] * (1LL<<i);
}
return ret;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |