# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
42490 | nonocut | Treasure (different grader from official contest) (CEOI13_treasure2) | C++14 | 2 ms | 804 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"
#include<bits/stdc++.h>
using namespace std;
int s1[105][105], s2[105][105], s3[105][105], s4[105][105];
int a[105][105];
void findTreasure (int N) {
//section1
for(int i=1;i<=N/2+2;i++) {
for(int j=1;j<=N/2+1;j++) {
s1[i][j] = countTreasure(i,j,N,N);
}
}
//section 2
for(int i=N/2;i<=N;i++) {
for(int j=1;j<=N/2+1;j++) {
s2[i][j] = countTreasure(1,j,i,N);
}
}
//section 3
for(int i=1;i<=N/2+1;i++) {
for(int j=N/2;j<=N;j++) {
s3[i][j] = countTreasure(i,1,N,j);
}
}
//section 4
for(int i=N/2;i<=N;i++) {
for(int j=N/2;j<=N;j++) {
s4[i][j] = countTreasure(1,1,i,j);
}
}
for(int i=1;i<=N;i++) {
for(int j=1;j<=N;j++) {
if(i<=N/2 && j<=N/2) a[i][j] = s1[i][j] - s1[i+1][j] - s1[i][j+1] + s1[i+1][j+1];
if(i>=N/2+1 && j<=N/2) a[i][j] = s2[i][j] - s2[i-1][j] - s2[i][j+1] + s2[i-1][j+1];
if(i<=N/2 && j>=N/2+1) a[i][j] = s3[i][j] - s3[i+1][j] - s3[i][j-1] + s3[i+1][j-1];
if(i>=N/2+1 && j>=N/2+1) a[i][j] = s4[i][j] - s4[i-1][j] - s4[i][j-1] + s4[i-1][j-1];
if(a[i][j]) Report(i,j);
// printf("%d",a[i][j]);
}
// printf("\n");
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |