#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;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
4 ms |
752 KB |
Wrong Answer [7] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
36 ms |
2592 KB |
Wrong Answer [7] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
2768 KB |
Output is correct |
2 |
Correct |
6 ms |
2768 KB |
Output is correct |
3 |
Correct |
4 ms |
2768 KB |
Output is correct |
4 |
Correct |
4 ms |
2768 KB |
Output is correct |
5 |
Correct |
5 ms |
2768 KB |
Output is correct |
6 |
Correct |
5 ms |
2768 KB |
Output is correct |
7 |
Correct |
5 ms |
2768 KB |
Output is correct |
8 |
Correct |
4 ms |
2768 KB |
Output is correct |
9 |
Correct |
12 ms |
2984 KB |
Output is correct |
10 |
Correct |
12 ms |
3160 KB |
Output is correct |
11 |
Correct |
13 ms |
3420 KB |
Output is correct |
12 |
Correct |
4 ms |
3504 KB |
Output is correct |
13 |
Correct |
4 ms |
3504 KB |
Output is correct |
14 |
Correct |
4 ms |
3504 KB |
Output is correct |
15 |
Correct |
4 ms |
3504 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
23 ms |
4332 KB |
Wrong Answer [7] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
23 ms |
4776 KB |
Wrong Answer [7] |
2 |
Halted |
0 ms |
0 KB |
- |