# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
210498 | alexandra_udristoiu | Treasure (different grader from official contest) (CEOI13_treasure2) | C++14 | 6 ms | 552 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<iostream>
#include "treasure.h"
using namespace std;
static int a[105][105];
void findTreasure (int n) {
int i, j, val;
for(i = n / 2 + 1; i <= n; i++){
for(j = n / 2 + 1; j <= n; j++){
a[i][j] = countTreasure(1, 1, i, j);
}
for(j = 1; j <= n / 2; j++){
a[i][j] = a[i][n] - countTreasure(1, j + 1, i, n);
}
}
for(i = n / 2; i >= 1; i--){
for(j = n / 2 + 1; j <= n; j++){
a[i][j] = a[n][j] - countTreasure(i + 1, 1, n, j);
}
for(j = n / 2; j >= 1; j--){
a[i][j] = a[i][n] + a[n][j] + countTreasure(i + 1, j + 1, n, n) - a[n][n];
}
}
for(i = 1; i <= n; i++){
for(j = 1; j <= n; j++){
val = a[i][j] - a[i - 1][j] - a[i][j - 1] + a[i - 1][j - 1];
if(val == 1){
Report(i, j);
}
}
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |