제출 #480717

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
4807172021-10-18 00:49:46Mackerel_PikeThe Kingdom of JOIOI (JOI17_joioi)C++14
100 / 100
628 ms54936 KiB
#include <bits/stdc++.h>
using namespace std;
const int maxn = 2005;
int n, m, mn, mx;
int a[maxn][maxn];
int l[maxn], r[maxn];
inline bool solve(int md){
for(int i = 0; i < n; ++i){
for(r[i] = -1; r[i] + 1 < m && a[i][r[i] + 1] >= mx - md; ++r[i]);
for(l[i] = m; l[i] - 1 >= 0 && a[i][l[i] - 1] <= mn + md; --l[i]);
--l[i];
if(l[i] > r[i])
return false;
}
int lst = -1; bool ok = true;
for(int i = 0; i < n; ++i){
lst = max(lst, l[i]);
ok &= (lst <= r[i]);
}
if(ok)
return true;
lst = m;
for(int i = 0; i < n; ++i){
lst = min(lst, r[i]);
if(lst < l[i])
return false;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

컴파일 시 표준 에러 (stderr) 메시지

joioi.cpp: In function 'int main()':
joioi.cpp:55:17: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   55 |     int md = lb + rb >> 1;
      |              ~~~^~~~
joioi.cpp:46:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   46 |   scanf("%d%d", &n, &m);
      |   ~~~~~^~~~~~~~~~~~~~~~
joioi.cpp:51:12: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   51 |       scanf("%d", &a[i][j]), mx = max(mx, a[i][j]), mn = min(mn, a[i][j]);
      |       ~~~~~^~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...