Submission #173443

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
1734432020-01-04 06:30:27dennisstarThe Kingdom of JOIOI (JOI17_joioi)C++11
100 / 100
933 ms133752 KiB
#include <bits/stdc++.h>
#define fi first
#define se second
#define ryan bear
#define all(V) ((V).begin()), ((V).end())
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef long double ld;
typedef vector<int> vim;
typedef vector<ll> vlm;
int H, W;
int ar[2010][2010], im[2010][2010];
int Lmn[2010][2010], Lmx[2010][2010], Rmn[2010][2010], Rmx[2010][2010];
int lb[2010];
void init() {
for (int i=1; i<=H; i++) Lmn[i][0]=Rmn[i][W+1]=(1<<30);
for (int i=1; i<=W; i++) Lmn[0][i]=Rmn[H+1][i]=(1<<30);
for (int i=1; i<=H; i++) for (int j=1; j<=W; j++) {
Lmn[i][j]=min({ar[i][j], Lmn[i-1][j], Lmn[i][j-1]});
Lmx[i][j]=max({ar[i][j], Lmx[i-1][j], Lmx[i][j-1]});
}
for (int i=H; i>=1; i--) for (int j=W; j>=1; j--) {
Rmn[i][j]=min({ar[i][j], Rmn[i+1][j], Rmn[i][j+1]});
Rmx[i][j]=max({ar[i][j], Rmx[i+1][j], Rmx[i][j+1]});
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

joioi.cpp: In function 'int solve()':
joioi.cpp:53:28: warning: unused variable 'ret' [-Wunused-variable]
  int s=mx-mn, e=Lmx[H][W], ret;
                            ^~~
joioi.cpp: In function 'int main()':
joioi.cpp:67:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d %d", &H, &W);
  ~~~~~^~~~~~~~~~~~~~~~~
joioi.cpp:68:57: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  for (int i=1; i<=H; i++) for (int j=1; j<=W; j++) scanf("%d", &ar[i][j]);
                                                    ~~~~~^~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...