# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
91898 | easrui | Treasure (different grader from official contest) (CEOI13_treasure2) | C++14 | 1084 ms | 400 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 <bits/stdc++.h>
#include "treasure.h"
using namespace std;
int S[101][101]; // S[a][b] a행 b열까지합
void findTreasure(int N){
int L,R,U,D,tmp,res;
L=1,R=N,U=1,D=N;
tmp = countTreasure(L,1,R,N);
for(U=2,D=N;U<=(1+N)/2;U++){
res = countTreasure(L,U,R,D);
if(L=1) S[U-1][R] = tmp - res;
else S[U-1][L-1] = S[U-1][N] - (tmp - res);
tmp = res;
}
tmp = countTreasure(L,1,R,N);
for(U=1,D=N-1;D>(1+N)/2;D--){
res = countTreasure(L,U,R,D);
if(L=1) S[U-1][R] = tmp - res;
else S[U-1][L-1] = S[U-1][N] - (tmp - res);
tmp = res;
}
for(L=2,R=N;L<=(1+N)/2;L++){
tmp = countTreasure(L,1,R,N);
for(U=2,D=N;U<=(1+N)/2;U++){
res = countTreasure(L,U,R,D);
if(L=1) S[U-1][R] = tmp - res;
else S[U-1][L-1] = S[U-1][N] - (tmp - res);
tmp = res;
}
tmp = countTreasure(L,1,R,N);
for(U=1,D=N-1;D>(1+N)/2;D--){
res = countTreasure(L,U,R,D);
if(L=1) S[U-1][R] = tmp - res;
else S[U-1][L-1] = S[U-1][N] - (tmp - res);
tmp = res;
}
}
for(L=1,R=N-1;R>(1+N)/2;R--){
tmp = countTreasure(L,1,R,N);
for(U=2,D=N;U<=(1+N)/2;U++){
res = countTreasure(L,U,R,D);
if(L=1) S[U-1][R] = tmp - res;
else S[U-1][L-1] = S[U-1][N] - (tmp - res);
tmp = res;
}
tmp = countTreasure(L,1,R,N);
for(U=1,D=N-1;D>(1+N)/2;D--){
res = countTreasure(L,U,R,D);
if(L=1) S[U-1][R] = tmp - res;
else S[U-1][L-1] = S[U-1][N] - (tmp - res);
tmp = res;
}
}
for(int x=1; x<=N; x++)
for(int y=1; y<=N; y++){
if(S[y][x]!=S[y][x-1]) Report(x,y);
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |