제출 #836686

#제출 시각아이디문제언어결과실행 시간메모리
83668612345678Just Long Neckties (JOI20_ho_t1)C++17
0 / 100
0 ms340 KiB
#include <bits/stdc++.h> using namespace std; const int nx=2e5+5; int n, a[nx], b[nx], l[nx], r[nx], mx; int main() { cin.tie(NULL)->sync_with_stdio(false); cin>>n; for (int i=1; i<=n+1; i++) cin>>a[i]; for (int i=1; i<=n; i++) cin>>b[i]; b[n+1]=1e9; sort(b+1, b+n+1); sort(a+1, a+n+2); for (int i=1; i<=n+1; i++) l[i]=max(l[i-1], a[i]-b[i]); for (int i=n; i>=1; i--) r[i]=max(r[i+1], a[i+1]-b[i]); for (int i=1; i<=n+1; i++) cout<<max(l[i], r[i])<<' '; }

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

ho_t1.cpp: In function 'int main()':
ho_t1.cpp:13:5: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   13 |     for (int i=1; i<=n; i++) cin>>b[i]; b[n+1]=1e9;
      |     ^~~
ho_t1.cpp:13:41: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   13 |     for (int i=1; i<=n; i++) cin>>b[i]; b[n+1]=1e9;
      |                                         ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...