#include "cmp.h"
#include <bits/stdc++.h>
using namespace std;
void remember(int a) {
int oneAmount = 0;
for (int i = 0; i < 12; i++)
if (a & (1 << i))
oneAmount++;
if (oneAmount > 6) {
bit_set(13);
a = -a;
}
for (int i = 0; i < 12; i++)
if ((1 << i) & a)
bit_set(i + 1);
}
int compare(int b) {
int d = bit_get(13);
int a = 0;
int mul = 1;
if (d) {
a = 1 << 12;
mul = -1;
}
for (int i = 0; i < 12; i++) {
int p = bit_get(i + 1);
a += (1 << i) * p * mul;
}
if (a > b)
return -1;
else if (a < b)
return 1;
else
return 0;
if ((a < b && !d) || (a > b && d))
return 1;
else
return -1;
}
//111101000010
//110101011111
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Partially correct |
3169 ms |
82500 KB |
Output is partially correct - maxAccess = 20, score = 10 |