# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
54656 | andy0220 | Treasure (different grader from official contest) (CEOI13_treasure2) | C++11 | 2 ms | 676 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 "treasure.h"
int ans[111][111];
int BIT(int i, int j) {
int k, l, imsi = 0;
for(k = i; k > 0; k -= (k & -k)) {
for(l = j; l > 0; l -= (j & -j)) {
imsi += ans[k][l];
}
}
for(k = i - 1; k > 0; k -= (k & -k)) {
for(l = j - 1; l > 0; l -= (j & -j)) {
imsi += ans[k][l];
}
}
for(k = i; k > 0; k -= (k & -k)) {
for(l = j - 1; l > 0; l -= (j & -j)) {
imsi -= ans[k][l];
}
}
for(k = i - 1; k > 0; k -= (k & -k)) {
for(l = j; l > 0; l -= (j & -j)) {
imsi -= ans[k][l];
}
}
return imsi;
}
void findTreasure (int N) {
int i, j;
for(i = 1; i <= N; i++) {
for(j = 1; j <= N; j++) {
ans[i][j] = countTreasure(i - (i & -i) + 1, j - (j & -j) + 1, i, j);
}
}
for(i = 1; i <= N; i++) {
for(j = 1; j <= N; j++) {
if(BIT(i, j)) Report(i, j);
}
}
return;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |